<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[198348] trunk/Source/JavaScriptCore</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/198348">198348</a></dd>
<dt>Author</dt> <dd>msaboff@apple.com</dd>
<dt>Date</dt> <dd>2016-03-17 13:13:18 -0700 (Thu, 17 Mar 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>[ES6] Getters and Setters should be prefixed appropriately
https://bugs.webkit.org/show_bug.cgi?id=155593
Reviewed by Mark Lam.
Changed the putDirectNativeIntrinsicGetter() to prepend "get " to the funtion name.
Updated places that had their own macro or hand constructed a getter function to use
the JSC_NATIVE_GETTER macro which will properly append "get ".
Prepended "get " and "set " to the __proto__ accessor created on the Object prototype.
When we create the Symbol.species getter, added an explicit function name of "get [Symbol.species]".
* inspector/JSInjectedScriptHostPrototype.cpp:
(Inspector::JSInjectedScriptHostPrototype::finishCreation):
(Inspector::jsInjectedScriptHostPrototypeAttributeEvaluate):
* inspector/JSJavaScriptCallFramePrototype.cpp:
(Inspector::JSJavaScriptCallFramePrototype::finishCreation):
(Inspector::jsJavaScriptCallFramePrototypeFunctionEvaluate):
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
* runtime/JSObject.cpp:
(JSC::JSObject::putDirectNativeIntrinsicGetter):
* runtime/MapPrototype.cpp:
(JSC::MapPrototype::finishCreation):
(JSC::MapPrototype::getOwnPropertySlot):
* runtime/SetPrototype.cpp:
(JSC::SetPrototype::finishCreation):
(JSC::SetPrototype::getOwnPropertySlot):
* tests/stress/accessors-get-set-prefix.js: Added.
(tryGetOwnPropertyDescriptorGetName):</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorJSInjectedScriptHostPrototypecpp">trunk/Source/JavaScriptCore/inspector/JSInjectedScriptHostPrototype.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorJSJavaScriptCallFramePrototypecpp">trunk/Source/JavaScriptCore/inspector/JSJavaScriptCallFramePrototype.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSGlobalObjectcpp">trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSObjectcpp">trunk/Source/JavaScriptCore/runtime/JSObject.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeMapPrototypecpp">trunk/Source/JavaScriptCore/runtime/MapPrototype.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeSetPrototypecpp">trunk/Source/JavaScriptCore/runtime/SetPrototype.cpp</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoretestsstressaccessorsgetsetprefixjs">trunk/Source/JavaScriptCore/tests/stress/accessors-get-set-prefix.js</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (198347 => 198348)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2016-03-17 19:28:24 UTC (rev 198347)
+++ trunk/Source/JavaScriptCore/ChangeLog        2016-03-17 20:13:18 UTC (rev 198348)
</span><span class="lines">@@ -1,3 +1,38 @@
</span><ins>+2016-03-17 Michael Saboff <msaboff@apple.com>
+
+ [ES6] Getters and Setters should be prefixed appropriately
+ https://bugs.webkit.org/show_bug.cgi?id=155593
+
+ Reviewed by Mark Lam.
+
+ Changed the putDirectNativeIntrinsicGetter() to prepend "get " to the funtion name.
+
+ Updated places that had their own macro or hand constructed a getter function to use
+ the JSC_NATIVE_GETTER macro which will properly append "get ".
+
+ Prepended "get " and "set " to the __proto__ accessor created on the Object prototype.
+
+ When we create the Symbol.species getter, added an explicit function name of "get [Symbol.species]".
+
+ * inspector/JSInjectedScriptHostPrototype.cpp:
+ (Inspector::JSInjectedScriptHostPrototype::finishCreation):
+ (Inspector::jsInjectedScriptHostPrototypeAttributeEvaluate):
+ * inspector/JSJavaScriptCallFramePrototype.cpp:
+ (Inspector::JSJavaScriptCallFramePrototype::finishCreation):
+ (Inspector::jsJavaScriptCallFramePrototypeFunctionEvaluate):
+ * runtime/JSGlobalObject.cpp:
+ (JSC::JSGlobalObject::init):
+ * runtime/JSObject.cpp:
+ (JSC::JSObject::putDirectNativeIntrinsicGetter):
+ * runtime/MapPrototype.cpp:
+ (JSC::MapPrototype::finishCreation):
+ (JSC::MapPrototype::getOwnPropertySlot):
+ * runtime/SetPrototype.cpp:
+ (JSC::SetPrototype::finishCreation):
+ (JSC::SetPrototype::getOwnPropertySlot):
+ * tests/stress/accessors-get-set-prefix.js: Added.
+ (tryGetOwnPropertyDescriptorGetName):
+
</ins><span class="cx"> 2016-03-16 Mark Lam <mark.lam@apple.com>
</span><span class="cx">
</span><span class="cx"> Method names should not appear in the lexical scope of the method's body.
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorJSInjectedScriptHostPrototypecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/JSInjectedScriptHostPrototype.cpp (198347 => 198348)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/JSInjectedScriptHostPrototype.cpp        2016-03-17 19:28:24 UTC (rev 198347)
+++ trunk/Source/JavaScriptCore/inspector/JSInjectedScriptHostPrototype.cpp        2016-03-17 20:13:18 UTC (rev 198348)
</span><span class="lines">@@ -70,11 +70,7 @@
</span><span class="cx"> JSC_NATIVE_FUNCTION_WITHOUT_TRANSITION("weakSetEntries", jsInjectedScriptHostPrototypeFunctionWeakSetEntries, DontEnum, 1);
</span><span class="cx"> JSC_NATIVE_FUNCTION_WITHOUT_TRANSITION("iteratorEntries", jsInjectedScriptHostPrototypeFunctionIteratorEntries, DontEnum, 1);
</span><span class="cx">
</span><del>- Identifier evaluateIdentifier = Identifier::fromString(&vm, "evaluate");
- GetterSetter* accessor = GetterSetter::create(vm, globalObject);
- JSFunction* function = JSFunction::create(vm, globalObject, 0, evaluateIdentifier.string(), jsInjectedScriptHostPrototypeAttributeEvaluate);
- accessor->setGetter(vm, globalObject, function);
- putDirectNonIndexAccessor(vm, evaluateIdentifier, accessor, DontEnum | Accessor);
</del><ins>+ JSC_NATIVE_GETTER("evaluate", jsInjectedScriptHostPrototypeAttributeEvaluate, DontEnum | Accessor);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL jsInjectedScriptHostPrototypeAttributeEvaluate(ExecState* exec)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorJSJavaScriptCallFramePrototypecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/JSJavaScriptCallFramePrototype.cpp (198347 => 198348)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/JSJavaScriptCallFramePrototype.cpp        2016-03-17 19:28:24 UTC (rev 198347)
+++ trunk/Source/JavaScriptCore/inspector/JSJavaScriptCallFramePrototype.cpp        2016-03-17 20:13:18 UTC (rev 198348)
</span><span class="lines">@@ -53,15 +53,6 @@
</span><span class="cx">
</span><span class="cx"> const ClassInfo JSJavaScriptCallFramePrototype::s_info = { "JavaScriptCallFrame", &Base::s_info, 0, CREATE_METHOD_TABLE(JSJavaScriptCallFramePrototype) };
</span><span class="cx">
</span><del>-#define JSC_NATIVE_NON_INDEX_ACCESSOR(jsName, cppName, attributes) \
- { \
- Identifier identifier = Identifier::fromString(&vm, jsName); \
- GetterSetter* accessor = GetterSetter::create(vm, globalObject); \
- JSFunction* function = JSFunction::create(vm, globalObject, 0, identifier.string(), cppName); \
- accessor->setGetter(vm, globalObject, function); \
- putDirectNonIndexAccessor(vm, identifier, accessor, (attributes)); \
- }
-
</del><span class="cx"> void JSJavaScriptCallFramePrototype::finishCreation(VM& vm, JSGlobalObject* globalObject)
</span><span class="cx"> {
</span><span class="cx"> Base::finishCreation(vm);
</span><span class="lines">@@ -71,14 +62,14 @@
</span><span class="cx"> JSC_NATIVE_FUNCTION_WITHOUT_TRANSITION("evaluate", jsJavaScriptCallFramePrototypeFunctionEvaluate, DontEnum, 1);
</span><span class="cx"> JSC_NATIVE_FUNCTION_WITHOUT_TRANSITION("scopeType", jsJavaScriptCallFramePrototypeFunctionScopeType, DontEnum, 1);
</span><span class="cx">
</span><del>- JSC_NATIVE_NON_INDEX_ACCESSOR("caller", jsJavaScriptCallFrameAttributeCaller, DontEnum | Accessor);
- JSC_NATIVE_NON_INDEX_ACCESSOR("sourceID", jsJavaScriptCallFrameAttributeSourceID, DontEnum | Accessor);
- JSC_NATIVE_NON_INDEX_ACCESSOR("line", jsJavaScriptCallFrameAttributeLine, DontEnum | Accessor);
- JSC_NATIVE_NON_INDEX_ACCESSOR("column", jsJavaScriptCallFrameAttributeColumn, DontEnum | Accessor);
- JSC_NATIVE_NON_INDEX_ACCESSOR("functionName", jsJavaScriptCallFrameAttributeFunctionName, DontEnum | Accessor);
- JSC_NATIVE_NON_INDEX_ACCESSOR("scopeChain", jsJavaScriptCallFrameAttributeScopeChain, DontEnum | Accessor);
- JSC_NATIVE_NON_INDEX_ACCESSOR("thisObject", jsJavaScriptCallFrameAttributeThisObject, DontEnum | Accessor);
- JSC_NATIVE_NON_INDEX_ACCESSOR("type", jsJavaScriptCallFrameAttributeType, DontEnum | Accessor);
</del><ins>+ JSC_NATIVE_GETTER("caller", jsJavaScriptCallFrameAttributeCaller, DontEnum | Accessor);
+ JSC_NATIVE_GETTER("sourceID", jsJavaScriptCallFrameAttributeSourceID, DontEnum | Accessor);
+ JSC_NATIVE_GETTER("line", jsJavaScriptCallFrameAttributeLine, DontEnum | Accessor);
+ JSC_NATIVE_GETTER("column", jsJavaScriptCallFrameAttributeColumn, DontEnum | Accessor);
+ JSC_NATIVE_GETTER("functionName", jsJavaScriptCallFrameAttributeFunctionName, DontEnum | Accessor);
+ JSC_NATIVE_GETTER("scopeChain", jsJavaScriptCallFrameAttributeScopeChain, DontEnum | Accessor);
+ JSC_NATIVE_GETTER("thisObject", jsJavaScriptCallFrameAttributeThisObject, DontEnum | Accessor);
+ JSC_NATIVE_GETTER("type", jsJavaScriptCallFrameAttributeType, DontEnum | Accessor);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL jsJavaScriptCallFramePrototypeFunctionEvaluate(ExecState* exec)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSGlobalObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp (198347 => 198348)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp        2016-03-17 19:28:24 UTC (rev 198347)
+++ trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp        2016-03-17 20:13:18 UTC (rev 198348)
</span><span class="lines">@@ -301,8 +301,8 @@
</span><span class="cx"> m_nullSetterFunction.set(vm, this, NullSetterFunction::create(vm, NullSetterFunction::createStructure(vm, this, m_functionPrototype.get())));
</span><span class="cx"> m_objectPrototype.set(vm, this, ObjectPrototype::create(vm, this, ObjectPrototype::createStructure(vm, this, jsNull())));
</span><span class="cx"> GetterSetter* protoAccessor = GetterSetter::create(vm, this);
</span><del>- protoAccessor->setGetter(vm, this, JSFunction::create(vm, this, 0, String(), globalFuncProtoGetter));
- protoAccessor->setSetter(vm, this, JSFunction::create(vm, this, 0, String(), globalFuncProtoSetter));
</del><ins>+ protoAccessor->setGetter(vm, this, JSFunction::create(vm, this, 0, makeString("get ", vm.propertyNames->underscoreProto.string()), globalFuncProtoGetter));
+ protoAccessor->setSetter(vm, this, JSFunction::create(vm, this, 0, makeString("set ", vm.propertyNames->underscoreProto.string()), globalFuncProtoSetter));
</ins><span class="cx"> m_objectPrototype->putDirectNonIndexAccessor(vm, vm.propertyNames->underscoreProto, protoAccessor, Accessor | DontEnum);
</span><span class="cx"> m_functionPrototype->structure()->setPrototypeWithoutTransition(vm, m_objectPrototype.get());
</span><span class="cx">
</span><span class="lines">@@ -408,7 +408,7 @@
</span><span class="cx"> // Constructors
</span><span class="cx">
</span><span class="cx"> GetterSetter* speciesGetterSetter = GetterSetter::create(vm, this);
</span><del>- speciesGetterSetter->setGetter(vm, this, JSFunction::createBuiltinFunction(vm, globalObjectSpeciesGetterCodeGenerator(vm), this));
</del><ins>+ speciesGetterSetter->setGetter(vm, this, JSFunction::createBuiltinFunction(vm, globalObjectSpeciesGetterCodeGenerator(vm), this, "get [Symbol.species]"));
</ins><span class="cx">
</span><span class="cx"> ObjectConstructor* objectConstructor = ObjectConstructor::create(vm, this, ObjectConstructor::createStructure(vm, this, m_functionPrototype.get()), m_objectPrototype.get());
</span><span class="cx"> m_objectConstructor.set(vm, this, objectConstructor);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSObject.cpp (198347 => 198348)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSObject.cpp        2016-03-17 19:28:24 UTC (rev 198347)
+++ trunk/Source/JavaScriptCore/runtime/JSObject.cpp        2016-03-17 20:13:18 UTC (rev 198348)
</span><span class="lines">@@ -2576,7 +2576,7 @@
</span><span class="cx"> bool JSObject::putDirectNativeIntrinsicGetter(VM& vm, JSGlobalObject* globalObject, Identifier name, NativeFunction nativeFunction, Intrinsic intrinsic, unsigned attributes)
</span><span class="cx"> {
</span><span class="cx"> GetterSetter* accessor = GetterSetter::create(vm, globalObject);
</span><del>- JSFunction* function = JSFunction::create(vm, globalObject, 0, name.string(), nativeFunction, intrinsic);
</del><ins>+ JSFunction* function = JSFunction::create(vm, globalObject, 0, makeString("get ", name.string()), nativeFunction, intrinsic);
</ins><span class="cx"> accessor->setGetter(vm, globalObject, function);
</span><span class="cx"> return putDirectNonIndexAccessor(vm, name, accessor, attributes);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeMapPrototypecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/MapPrototype.cpp (198347 => 198348)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/MapPrototype.cpp        2016-03-17 19:28:24 UTC (rev 198347)
+++ trunk/Source/JavaScriptCore/runtime/MapPrototype.cpp        2016-03-17 20:13:18 UTC (rev 198348)
</span><span class="lines">@@ -85,10 +85,7 @@
</span><span class="cx"> putDirectWithoutTransition(vm, vm.propertyNames->iteratorSymbol, entries, DontEnum);
</span><span class="cx"> putDirectWithoutTransition(vm, vm.propertyNames->toStringTagSymbol, jsString(&vm, "Map"), DontEnum | ReadOnly);
</span><span class="cx">
</span><del>- GetterSetter* accessor = GetterSetter::create(vm, globalObject);
- JSFunction* function = JSFunction::create(vm, globalObject, 0, vm.propertyNames->size.string(), mapProtoFuncSize);
- accessor->setGetter(vm, globalObject, function);
- putDirectNonIndexAccessor(vm, vm.propertyNames->size, accessor, DontEnum | Accessor);
</del><ins>+ JSC_NATIVE_GETTER(vm.propertyNames->size, mapProtoFuncSize, DontEnum | Accessor);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool MapPrototype::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeSetPrototypecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/SetPrototype.cpp (198347 => 198348)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/SetPrototype.cpp        2016-03-17 19:28:24 UTC (rev 198347)
+++ trunk/Source/JavaScriptCore/runtime/SetPrototype.cpp        2016-03-17 20:13:18 UTC (rev 198348)
</span><span class="lines">@@ -79,10 +79,7 @@
</span><span class="cx"> putDirectWithoutTransition(vm, vm.propertyNames->iteratorSymbol, values, DontEnum);
</span><span class="cx"> putDirectWithoutTransition(vm, vm.propertyNames->toStringTagSymbol, jsString(&vm, "Set"), DontEnum | ReadOnly);
</span><span class="cx">
</span><del>- GetterSetter* accessor = GetterSetter::create(vm, globalObject);
- JSFunction* function = JSFunction::create(vm, globalObject, 0, vm.propertyNames->size.string(), setProtoFuncSize);
- accessor->setGetter(vm, globalObject, function);
- putDirectNonIndexAccessor(vm, vm.propertyNames->size, accessor, DontEnum | Accessor);
</del><ins>+ JSC_NATIVE_GETTER(vm.propertyNames->size, setProtoFuncSize, DontEnum | Accessor);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool SetPrototype::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoretestsstressaccessorsgetsetprefixjs"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/tests/stress/accessors-get-set-prefix.js (0 => 198348)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/tests/stress/accessors-get-set-prefix.js         (rev 0)
+++ trunk/Source/JavaScriptCore/tests/stress/accessors-get-set-prefix.js        2016-03-17 20:13:18 UTC (rev 198348)
</span><span class="lines">@@ -0,0 +1,27 @@
</span><ins>+function tryGetOwnPropertyDescriptorGetName(obj, property, expectedName)
+{
+ let descriptor = Object.getOwnPropertyDescriptor(obj, property);
+ if (!descriptor)
+ throw "Couldn't find property descriptor on object " + obj.toString() + " for property " + property.toString();
+
+ let getter = descriptor.get;
+ if (!getter)
+ throw "Property " + property.toString() + " on object " + obj.toString() + " is not a getter";
+
+ let getterName = getter.name;
+ if (getterName !== expectedName)
+ throw "Wrong getter name for property " + property.toString() + " on object " + obj.toString() + " expected " + expectedName + " got " + getterName;
+}
+
+tryGetOwnPropertyDescriptorGetName(Array, Symbol.species, "get [Symbol.species]");
+tryGetOwnPropertyDescriptorGetName(Map.prototype, "size", "get size");
+tryGetOwnPropertyDescriptorGetName(Set.prototype, "size", "get size");
+
+if (Object.__lookupGetter__("__proto__").name !== "get __proto__")
+ throw "Expected Object __proto__ getter to be named \"get __proto\"";
+
+if (Object.__lookupSetter__("__proto__").name !== "set __proto__")
+ throw "Expected Object __proto__ setter to be named \"set __proto\"";
+
+if (Int32Array.prototype.__lookupGetter__("byteOffset").name !== "get byteOffset")
+ throw "Expected TypedArray.prototype byteOffset getter to be named \"get byteOffset\"";
</ins></span></pre>
</div>
</div>
</body>
</html>