summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Sotoudeh <matthewsot@outlook.com>2017-07-26 15:19:28 -0700
committerMatthew Sotoudeh <matthewsot@outlook.com>2017-07-26 15:19:28 -0700
commitf4635dac4198758e163f07f37508a50def95a9d6 (patch)
tree897067f4e6ef92295dc5441c2280b8e9b5104cd3
parente275ebdc473e79f773c277cfdf6037b6018f512b (diff)
comment explaining the js wrapping code
-rw-r--r--content/scripts/wrap-await.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/content/scripts/wrap-await.js b/content/scripts/wrap-await.js
index de3c864..eb24d00 100644
--- a/content/scripts/wrap-await.js
+++ b/content/scripts/wrap-await.js
@@ -1,3 +1,17 @@
+/*
+ * Because our custom prompt uses a callback/promise,
+ * we need to modify the code to ensure that it works
+ * as the student expects.
+ *
+ * The wrapAwait function returns a new script that
+ * marks all global functions async, then awaits all
+ * function calls.
+ *
+ * NOTE - this has serious issues for more complex
+ * Javascript, so using this for anything beyond
+ * introductory code is not supported or tested.
+ */
+
let esprima = require("esprima");
let escodegen = require("escodegen");
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback