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

ES5 Strict mode semantics not fully implemented according to specification #403

Open
ThomasHickman opened this issue Mar 10, 2018 · 0 comments
Labels
Ecma Incompatibility Issues about Rhino being incompatible with the EcmaScript spec Strict Mode Issues related to non-compliance with the ES5 Strict Mode spec
Milestone

Comments

@ThomasHickman
Copy link

ThomasHickman commented Mar 10, 2018

From https://www.ecma-international.org/publications/files/ECMA-ST/Ecma-262.pdf § 10.2.1 (page 232 in the pdf):

Eval code is strict mode code if it begins with a Directive Prologue that contains a Use Strict Directive or if the call to eval is a direct eval that is contained in strict mode code.

$ java -jar rhino-1.7.9-SNAPSHOT.jar
Rhino 1.7.9-SNAPSHOT 2018 03 10
js> (function() {"use strict"; var indirect_eval = eval;indirect_eval("with(this){}")})()
js: "eval code#1(eval)", line 1: uncaught JavaScript runtime exception: SyntaxError: with statements not allowed in strict mode

js: with(this){}
js: ....^

Function code that is supplied as the arguments to the built‑in Function, Generator, and AsyncFunction constructors is strict mode code if the last argument is a String that when processed is a FunctionBody that begins with a Directive Prologue that contains a Use Strict Directive.

$ java -jar rhino-1.7.9-SNAPSHOT.jar
Rhino 1.7.9-SNAPSHOT 2018 03 10
js> (function() {"use strict"; Function("with(this){}")()})()
js: "<eval'ed string>#1(Function)", line 1: uncaught JavaScript runtime exception: SyntaxError: with statements not allowed in strict mode

js: function anonymous() {with(this){}
js: ..........................^
@ThomasHickman ThomasHickman changed the title Strict code semantics not implemented according to the JS 1.7 specification Strict mode semantics not implemented according to the JS 1.7 specification Mar 10, 2018
@p-bakker p-bakker added the Strict Mode Issues related to non-compliance with the ES5 Strict Mode spec label Jun 29, 2021
@p-bakker p-bakker added the Ecma Incompatibility Issues about Rhino being incompatible with the EcmaScript spec label Aug 23, 2024
@p-bakker p-bakker pinned this issue Aug 24, 2024
@p-bakker p-bakker added this to the ES5 milestone Aug 24, 2024
@p-bakker p-bakker changed the title Strict mode semantics not implemented according to the JS 1.7 specification ES5 Strict mode semantics not fully implemented according to specification Aug 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ecma Incompatibility Issues about Rhino being incompatible with the EcmaScript spec Strict Mode Issues related to non-compliance with the ES5 Strict Mode spec
Projects
None yet
Development

No branches or pull requests

2 participants