Skip to content

Commit

Permalink
TODO
Browse files Browse the repository at this point in the history
  • Loading branch information
overlookmotel committed Nov 23, 2023
1 parent f726800 commit 7a24c00
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -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; };
};
```

0 comments on commit 7a24c00

Please sign in to comment.