[JSC] Add Symbol.prototype.description getter
authorutatane.tea@gmail.com <utatane.tea@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 1 Jun 2018 19:06:36 +0000 (19:06 +0000)
committerutatane.tea@gmail.com <utatane.tea@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 1 Jun 2018 19:06:36 +0000 (19:06 +0000)
commit5a16b5e42a2705bbe4f3fb71be4e96d6c9eec05e
treefd7a9b33d8582b74fbd893d918c1152d343379ff
parentc3b4a2526ffcb63133c4e3fc70c920813f746a02
[JSC] Add Symbol.prototype.description getter
https://bugs.webkit.org/show_bug.cgi?id=186053

Reviewed by Keith Miller.

JSTests:

* stress/symbol-description.js: Added.
(shouldBe):
(shouldThrow):

Source/JavaScriptCore:

Symbol.prototype.description accessor  is now stage 3[1].
This adds a getter to retrieve [[Description]] value from Symbol.
Previously, Symbol#toString() returns `Symbol(${description})` value.
So users need to extract `description` part if they want it.

[1]: https://tc39.github.io/proposal-Symbol-description/

* runtime/Symbol.cpp:
(JSC::Symbol::description const):
* runtime/Symbol.h:
* runtime/SymbolPrototype.cpp:
(JSC::tryExtractSymbol):
(JSC::symbolProtoGetterDescription):
(JSC::symbolProtoFuncToString):
(JSC::symbolProtoFuncValueOf):

LayoutTests:

* js/Object-getOwnPropertyNames-expected.txt:
* js/script-tests/Object-getOwnPropertyNames.js:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@232404 268f45cc-cd09-0410-ab3c-d52691b4dbfc
JSTests/ChangeLog
JSTests/stress/symbol-description.js [new file with mode: 0644]
LayoutTests/ChangeLog
LayoutTests/js/Object-getOwnPropertyNames-expected.txt
LayoutTests/js/script-tests/Object-getOwnPropertyNames.js
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/runtime/Symbol.cpp
Source/JavaScriptCore/runtime/Symbol.h
Source/JavaScriptCore/runtime/SymbolPrototype.cpp