-
Notifications
You must be signed in to change notification settings - Fork 862
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
Strict mode in runtime #227
Conversation
Other restriction and exceptions in runtime. http://www.ecma-international.org/ecma-262/5.1/#sec-C
|
May I delete the deprecated method? For example, If a bytecode compiled with 1.7.7, do you need to be able to execute it in 1.7.8? |
ECMAScript 5.1 > The LeftHandSide also may not be a reference to a data property with the attribute value {[[Writable]]:false}, to an accessor property with the attribute value {[[Set]]:undefined}, nor to a non-existent property of an object whose [[Extensible]] internal property has the value false. In these cases a TypeError exception is thrown (11.13.1).
An accessor property do not have [[Writable]] attribute. > 9.1.5.1 OrdinaryGetOwnProperty (O, P) > 5. If X is a data property, then > a. Set D.[[Value]] to the value of X’s [[Value]] attribute. > b. Set D.[[Writable]] to the value of X’s [[Writable]] attribute > 6. Else X is an accessor property, so > a. Set D.[[Get]] to the value of X’s [[Get]] attribute. > b. Set D.[[Set]] to the value of X’s [[Set]] attribute.
Wow, let me test this out as best I can but in general and with the test262 test suite it looks basically good and long overdue -- so thanks! AFAIK we have never said anything about what happens when you compile a class with one version of Rhino and use it with another. I also know that we have changed this internal interface in the past -- although we release a lot more often these days. I wonder if we could put some version in the bytecode to make it easier to detect when this happens? |
I tried to build Trireme (https://github.com/apigee/trireme) with this patch and I immediately ran into a NullPointerException where one didn't exist before -- it seems that somewhere in the call chain, the pointer to "this" was getting lost. I haven't been able to track this down, but perhaps you have some ideas... Caused by: org.mozilla.javascript.WrappedException: Wrapped java.lang.NullPointerException (crypto.js#614) |
Thanks! I tried to build Trireme. But I could not.
|
I found few deprecated method in ScriptRuntime.java. I thought they had been left for compatibility.
In that case, I think it is no problem to deleted. |
Yeah, now that I re-test it looks like the regression was introduced by On Thu, Aug 27, 2015 at 6:43 PM, tuchida [email protected] wrote:
Greg Brail | apigee https://apigee.com/ | twitter @gbrail |
On the deprecation thing, I was thinking about the fact that this PR changes the format of compiled bytecode, so that bytecode compiled with this version won't work with older versions. But like I said, that has happened before. I don't think we should remove additional "deprecated" functions from ScriptRuntime, however -- there is so much code out there that uses Rhino in unusual ways, I would be afraid of breaking it. |
Thanks for merge.
I see. |
Rhino implemented strict mode in parsing.
But do not implement in runtime.