Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix arrow functions not being able to be strict #323

Closed

Conversation

mstoykov
Copy link
Contributor

No description provided.

@mstoykov
Copy link
Contributor Author

From at least my reading of the relevant parts of ES6 (and the test that failed on my other tries) the way I have now restructured the ifs is a lot more closely what the standard says directly.

Just to reiterate the problem was the previously if you had (s) => {'use strict'; ...} that would be a syntax error, and it shouldn't be. Unfortunately ... I don't think there is any tc39 test that can catch that as it does require the existence of a parameter(as my 'fix test' commit shows 🤦 ).

@dop251
Copy link
Owner

dop251 commented Aug 10, 2021

Hi. Thanks for reporting this. It's actually pretty trivial to test, I'm going to push a fix shortly.

@dop251 dop251 closed this in acd0507 Aug 10, 2021
@mstoykov mstoykov deleted the fix/ArrowFunctionsCanBeStrict branch December 6, 2021 13:23
Gabri3l added a commit to mongodb-forks/goja that referenced this pull request Feb 4, 2022
…formats, ... (#47)

* Fixed typed arrays' defineProperty and indexing. Fixes dop251#308.
* Fix Proxy creation panicing on target not callable
* Do not modify sb for variadic calls as it breaks local variables resolution. Instead place a marker on stack and use it to count the number of args. Fixes dop251#311.
* Support patterns in catch clause. See dop251#305
* Fixed the handling of Symbol properties in destructuring assignments. Fixes dop251#312.
* Ensure ToPropertyKey happens earlier when assigning computed keys. Fixes dop251#312.
* Aligned detached buffer semantics with the latest specs. Fixes dop251#315.
* More typed arrays fixes
* Fixed accessor and property key function names. Fixes dop251#314.
* Fixed possible panic when sorting non-standard arrays.
* Added nil-safety checks for values returned by get*() methods
* Fixed panics in parser on some invalid inputs. Fixes dop251#318.
* Arrow function (dop251#319)
* Implemented arrow functions. See dop251#304.
* Define the name property for anonymous functions (including arrow functions)
* Treat "arguments" as a lexical binding to match the latest specification
* Allow arrow functions to contain 'use strict' for simple parameter lists. Fixes dop251#323.
* Fixed argument variable reference resolution in stashless functions
* Treat date-only formats as UTC and date-time as local timezone. Added support for additional datetime formats. Fixes dop251#281, fixes dop251#292.
* Use correct createArgsRest variant when arguments are not in stash. Fixes dop251#327
* Fixed formatting for go 1.17
* Report 'length' as own property for Go slices. Fixes dop251#328.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants