Add toJS for JSC::PrivateName
https://bugs.webkit.org/show_bug.cgi?id=161522
Reviewed by Ryosuke Niwa.
Source/JavaScriptCore:
Add the export annotation.
And we perform refactoring RefPtr<SymbolImpl> => Ref<SymbolImpl> for PrivateName,
since PrivateName never holds null SymbolImpl pointer. And along with this change,
we changed SymbolImpl* to SymbolImpl& in PrivateName::uid() callers.
* runtime/Completion.cpp:
(JSC::createSymbolForEntryPointModule):
* runtime/IdentifierInlines.h:
(JSC::Identifier::fromUid):
* runtime/JSFunction.cpp:
(JSC::JSFunction::setFunctionName):
* runtime/PrivateName.h:
(JSC::PrivateName::PrivateName):
(JSC::PrivateName::uid): Ugly const_cast. But const annotation is meaningless for SymbolImpl.
StringImpl should be observed as an immutable object. (Of course, its hash members etc. are mutable.
But most of the users (One of the exceptions is the concurrent JIT compiling thread!) should not care about this.)
(JSC::PrivateName::operator==):
(JSC::PrivateName::operator!=):
* runtime/PropertyName.h:
(JSC::PropertyName::PropertyName):
* runtime/Symbol.cpp:
(JSC::Symbol::finishCreation):
* runtime/Symbol.h:
* runtime/SymbolConstructor.cpp:
(JSC::symbolConstructorKeyFor):
Source/WebCore:
JSC::PrivateName is the wrapper to create and hold the ES6 Symbol instance.
This patch adds toJS support for JSC::PrivateName.
Later, the module integration patch will use this feature to call
DeferredWrapper::{resolve,reject} with JSC::PrivateName.
* bindings/js/JSDOMBinding.h:
(WebCore::toJS):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@205335 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/JavaScriptCore/runtime/Symbol.h b/Source/JavaScriptCore/runtime/Symbol.h
index 933a2e5..8c70306 100644
--- a/Source/JavaScriptCore/runtime/Symbol.h
+++ b/Source/JavaScriptCore/runtime/Symbol.h
@@ -49,7 +49,7 @@
static Symbol* create(VM&);
static Symbol* create(ExecState*, JSString* description);
- static Symbol* create(VM&, SymbolImpl& uid);
+ JS_EXPORT_PRIVATE static Symbol* create(VM&, SymbolImpl& uid);
const PrivateName& privateName() const { return m_privateName; }
String descriptiveString() const;