Improve Symbol() to string coercion error message
authorutatane.tea@gmail.com <utatane.tea@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 4 May 2016 01:21:38 +0000 (01:21 +0000)
committerutatane.tea@gmail.com <utatane.tea@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 4 May 2016 01:21:38 +0000 (01:21 +0000)
commit899809968ed8f7e9995ccc4a1aba8777ba056339
tree3383734f9d745ff7fdabce9fa0c266579ba659e8
parentb22d4731b4a9b5e4f2931b06da8ad5841811e92f
Improve Symbol() to string coercion error message
https://bugs.webkit.org/show_bug.cgi?id=157317

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

Improve error messages related to Symbols.

* runtime/JSCJSValue.cpp:
(JSC::JSValue::toStringSlowCase):
* runtime/Symbol.cpp:
(JSC::Symbol::toNumber):
* runtime/SymbolConstructor.cpp:
(JSC::symbolConstructorKeyFor):
* runtime/SymbolPrototype.cpp:
(JSC::symbolProtoFuncToString):
(JSC::symbolProtoFuncValueOf):
* tests/stress/dfg-to-primitive-pass-symbol.js:
* tests/stress/floating-point-div-to-mul.js:
(i.catch):
* tests/stress/string-from-code-point.js:
(shouldThrow):
(string_appeared_here.shouldThrow):
* tests/stress/symbol-error-messages.js: Added.
(shouldThrow):
* tests/stress/symbol-registry.js:

LayoutTests:

* js/math-clz32-expected.txt:
* js/script-tests/symbol-abstract-relational-comparison.js:
(relationalOperators.forEach):
* js/script-tests/symbol-object.js:
* js/script-tests/symbol-prototype-is-ordinary-object.js:
* js/script-tests/symbol-tostring.js:
* js/string-code-point-at-expected.txt:
* js/symbol-abstract-relational-comparison-expected.txt:
* js/symbol-object-expected.txt:
* js/symbol-prototype-is-ordinary-object-expected.txt:
* js/symbol-tostring-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@200402 268f45cc-cd09-0410-ab3c-d52691b4dbfc
21 files changed:
LayoutTests/ChangeLog
LayoutTests/js/math-clz32-expected.txt
LayoutTests/js/script-tests/symbol-abstract-relational-comparison.js
LayoutTests/js/script-tests/symbol-object.js
LayoutTests/js/script-tests/symbol-prototype-is-ordinary-object.js
LayoutTests/js/script-tests/symbol-tostring.js
LayoutTests/js/string-code-point-at-expected.txt
LayoutTests/js/symbol-abstract-relational-comparison-expected.txt
LayoutTests/js/symbol-object-expected.txt
LayoutTests/js/symbol-prototype-is-ordinary-object-expected.txt
LayoutTests/js/symbol-tostring-expected.txt
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/runtime/JSCJSValue.cpp
Source/JavaScriptCore/runtime/Symbol.cpp
Source/JavaScriptCore/runtime/SymbolConstructor.cpp
Source/JavaScriptCore/runtime/SymbolPrototype.cpp
Source/JavaScriptCore/tests/stress/dfg-to-primitive-pass-symbol.js
Source/JavaScriptCore/tests/stress/floating-point-div-to-mul.js
Source/JavaScriptCore/tests/stress/string-from-code-point.js
Source/JavaScriptCore/tests/stress/symbol-error-messages.js [new file with mode: 0644]
Source/JavaScriptCore/tests/stress/symbol-registry.js