You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
constcode1="'use\\u0020strict';";constestree1=require("acorn").parse(code1,{ecmaVersion:2020});constcode2=require("escodegen").generate(estree1);console.log(code2)// prints "'use strict';" instead of "'use\\u0020strict';"
There exists some test262s which account for that:
There is a field in the entree spec which saves the raw value of directives: https://github.com/estree/estree/blob/master/es5.md#directive
Because escodegen does not use this field, it transform invalid use-strict directives into valid ones:
There exists some test262s which account for that:
https://github.com/tc39/test262/blob/main/test/language/directive-prologue/14.1-5-s.js
https://github.com/tc39/test262/blob/main/test/language/directive-prologue/14.1-4-s.js
Kind regards,
Laurent
The text was updated successfully, but these errors were encountered: