Make custom Error properties (line, column, sourceURL) configurable and writable
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 19 Aug 2016 22:49:26 +0000 (22:49 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 19 Aug 2016 22:49:26 +0000 (22:49 +0000)
commit1c70b250a2dc0cc3c914073187ae9f0f4e6ecffa
tree123641007ef43dff9eec4456712a6a9c82beb4c6
parent91bc3a2274796a38486bf0ef7a850e6d9ba23e17
Make custom Error properties (line, column, sourceURL) configurable and writable
https://bugs.webkit.org/show_bug.cgi?id=160984
<rdar://problem/27905979>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-08-19
Reviewed by Saam Barati.

JSTests:

* stress/native-error-properties.js: Added.
(assert):
(shouldNotThrow):

(checkEmptyErrorPropertiesDescriptors):
(checkNonEmptyErrorPropertiesDescriptors):
The spec only describes the "message" property, so
ensure it has the right descriptor attributes.

(checkErrorPropertiesWritable):
Ensure common error property names are writable.
In strict mode this would have thrown an exception
if they were readonly.

Source/JavaScriptCore:

* runtime/Error.cpp:
(JSC::addErrorInfoAndGetBytecodeOffset):
(JSC::addErrorInfo):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@204663 268f45cc-cd09-0410-ab3c-d52691b4dbfc
JSTests/ChangeLog
JSTests/stress/native-error-properties.js [new file with mode: 0644]
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/runtime/Error.cpp