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

Failed to conform to ES5.1, Section 8.7.2 PutValue (V, W), [[Put]], Step 2.a #1

Closed
daejunpark opened this issue Apr 7, 2015 · 1 comment

Comments

@daejunpark
Copy link

It seems to me that SAFE does not conform to ES5.1, Section 8.7.2 PutValue (V, W), [[Put]], Step 2.a.

For the following test program:

// 8.7.2 PutValue (V, W), [[Put]], Step 2.a

// 2. If the result of calling the [[CanPut]] internal method of O with argument P is false, then
//     a. If Throw is true, then throw a TypeError exception.
//     b. ...

// For [[Put]] for a reference with a primitive base,
// if [[CanPut]] returns false, and Throw is true, then it throws TypeError.

// NOTE: In this example, [[CanPut]] returns false, because 'writable' is false.

"use strict";
Object.defineProperty(Number.prototype, "x", { "value" : 0, "writable" : false, "enumerable" : true, "configurable" : true });
1["x"] = 10; // TypeError

SAFE failed to throw a TypeError exception:

$ ./bin/jsaf interpret 02.js
Normal(10)

Is there anything that I'm missing?

@sukyoung
Copy link
Owner

sukyoung commented May 3, 2015

Thank you for the report. Currently, SAFE focuses on static analysis of JavaScript programs rather than interpretation of them. While the SAFE interpreter does not support the strict mode at the moment, the SAFE bug detector using static analysis results supports it.

@sukyoung sukyoung closed this as completed May 3, 2015
GMBale added a commit that referenced this issue May 13, 2021
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

No branches or pull requests

2 participants