diff options
author | Matthew Sotoudeh <matthewsot@outlook.com> | 2017-07-26 15:19:28 -0700 |
---|---|---|
committer | Matthew Sotoudeh <matthewsot@outlook.com> | 2017-07-26 15:19:28 -0700 |
commit | f4635dac4198758e163f07f37508a50def95a9d6 (patch) | |
tree | 897067f4e6ef92295dc5441c2280b8e9b5104cd3 | |
parent | e275ebdc473e79f773c277cfdf6037b6018f512b (diff) |
comment explaining the js wrapping code
-rw-r--r-- | content/scripts/wrap-await.js | 14 |
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"); |