-
Notifications
You must be signed in to change notification settings - Fork 783
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
Safari: Error#column is read only #1290
Comments
With this situation, any Error object that Esprima is throwing is going to have a wrong value for |
Why not use the |
@gibson042 Because that doesn't change the value of |
@ariya It should because you're adding an own-property to the freshly created object that has the Error object as its prototype. The problem with leaving it this way for now is that, in strict mode, the write throws an error instead of just silently failing. I think the best thing to do for now would be either use |
@ariya http://jsbin.com/zihasukaku/edit?js,console function createError(msg) {
var error = Object.create(new Error(msg));
Object.defineProperty(error, 'column', { value: 42 });
return error;
} |
@gibson042 With Safari 8, your JSBin snippet produces:
With Chrome and Firefox, the output is
|
Ah, I didn't see the problem introduced by And note that even though the above works on other browsers, it is only needed for Safari. |
That's the difference between Safari 8 and 9:
|
- bump to mocha 1.21.5 in order to remove "*" version-range on the "debug"-dependency - explicit use of "dot"-reporter for mocha 1.21.5, fixes failing tests of console.log output - fix tests running in the browser: assign variable "global" with global "this", backport from master-branch - update saucelab config: - Remove Safari 6 and 7 that are not supported by saucelabs anymore and cause timeouts when running the saucelabs tests. - Add Safari 8 - Note: The tests fail with Safari 9 and 10 because in these versions the "column"-property of "Error" is read-only (see jquery/esprima#1290) - firefox needs explicit platform and version specifier
- bump to mocha 1.21.5 in order to remove "*" version-range on the "debug"-dependency - explicit use of "dot"-reporter for mocha 1.21.5, fixes failing tests of console.log output - fix tests running in the browser: assign variable "global" with global "this", backport from master-branch - sync saucelab config with master branch: - Remove Safari 6 and 7 that are not supported by saucelabs anymore and cause timeouts when running the saucelabs tests. - Add Safari 8 and Safari 9 - Note: The tests fail with Safari 9 and 10 because in these versions the "column"-property of "Error" is read-only (see jquery/esprima#1290) - Firefox needs explicit platform specifier
- bump to mocha 1.21.5 in order to remove "*" version-range on the "debug"-dependency - explicit use of "dot"-reporter for mocha 1.21.5, fixes failing tests of console.log output - fix tests running in the browser: assign variable "global" with global "this", backport from master-branch - sync saucelab config with master branch: - Remove Safari 6 and 7 that are not supported by saucelabs anymore and cause timeouts when running the saucelabs tests. - Add Safari 8 and Safari 9 - Note: The tests fail with Safari 9 and 10 because in these versions the "column"-property of "Error" is read-only (see jquery/esprima#1290) - Firefox needs explicit platform specifier
- bump to mocha 1.21.5 in order to remove "*" version-range on the "debug"-dependency - explicit use of "dot"-reporter for mocha 1.21.5, fixes failing tests of console.log output - fix tests running in the browser: assign variable "global" with global "this", backport from master-branch - sync saucelab config with master branch: - Remove Safari 6 and 7 that are not supported by saucelabs anymore and cause timeouts when running the saucelabs tests. - Add Safari 8 and Safari 9 - Note: The tests fail with Safari 9 and 10 because in these versions the "column"-property of "Error" is read-only (see jquery/esprima#1290) - Firefox needs explicit platform specifier
This is related to #1284. See also: https://bugs.webkit.org/show_bug.cgi?id=146047
Some unit tests (that check for invalid syntax) fail on Safari. This is because
column
property of anError
object is read only.Run this on Safari (or check this snippet: http://jsbin.com/pexocaruce/edit?js,console):
It should say that column is 25, despite the fact that its value is set to 42. Chrome and Firefox behave as expected, showing 42.
The text was updated successfully, but these errors were encountered: