From 7a24c0008cb9a466038b908be283b3c164483273 Mon Sep 17 00:00:00 2001 From: overlookmotel Date: Wed, 22 Nov 2023 23:52:44 +0000 Subject: [PATCH] TODO --- TODO.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 TODO.md diff --git a/TODO.md b/TODO.md new file mode 100644 index 00000000..add460c3 --- /dev/null +++ b/TODO.md @@ -0,0 +1,30 @@ +# TODO + +* Tests +* Deal with duplicate bindings: + * Hoisted sloppy functions - actually no need, because `isFunction` means both are frozen anyway + * `for (let x of (() => x, [])) eval('x');` - done, but write test + * `function (x, _ = eval('x')) { var x; return x; }` - done (apart from `arguments`), but write test +* Tests for binding in higher scope which is shadowed still not being renamed + e.g. `() => { let x = 1; { let x; eval('typeof a !== "undefined" && a = 2'); } return x; }` - make sure param `x` not renamed to `a` + * Make sure this includes vars which are illegal to access inside `eval()` if `eval()` is strict mode. +* Test for const violations with frozen vars when internal to function: + +```js +module.exports = function(module, exports) { + const x = 1; + eval('x'); + return () => { x = 2; }; +}; +``` + +Also where another binding which isn't frozen: + +```js +module.exports = function(module, exports) { + const x = 1; + eval('x'); + { const x = 2; } + return () => { x = 2; }; +}; +```