Bug 1314564 - toStringTag and species for SharedArrayBuffer. r=arai
authorLars T Hansen <lhansen@mozilla.com>
Wed, 02 Nov 2016 11:08:45 +0100
changeset 348067 b2b39f69581735e25f53b69ec51263f80a1a682a
parent 348066 d370d74e76d7783f664929eb6f32be9685e6ed41
child 348068 7185f2eb656a242c0bf4b56ac2f9731dc833bbdb
push id10298
push userraliiev@mozilla.com
push dateMon, 14 Nov 2016 12:33:03 +0000
treeherdermozilla-aurora@7e29173b1641 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersarai
bugs1314564
milestone52.0a1
Bug 1314564 - toStringTag and species for SharedArrayBuffer. r=arai
js/src/builtin/TypedArray.js
js/src/vm/SharedArrayObject.cpp
--- a/js/src/builtin/TypedArray.js
+++ b/js/src/builtin/TypedArray.js
@@ -1663,8 +1663,15 @@ function ArrayBufferStaticSlice(buf, sta
 }
 
 // ES 2016 draft Mar 25, 2016 24.1.3.3.
 function ArrayBufferSpecies() {
     // Step 1.
     return this;
 }
 _SetCanonicalName(ArrayBufferSpecies, "get [Symbol.species]");
+
+// ES 2017 proposal
+function SharedArrayBufferSpecies() {
+    // Step 1.
+    return this;
+}
+_SetCanonicalName(SharedArrayBufferSpecies, "get [Symbol.species]");
--- a/js/src/vm/SharedArrayObject.cpp
+++ b/js/src/vm/SharedArrayObject.cpp
@@ -366,25 +366,27 @@ static const ClassOps SharedArrayBufferO
     nullptr, /* trace */
 };
 
 static const JSFunctionSpec static_functions[] = {
     JS_FS_END
 };
 
 static const JSPropertySpec static_properties[] = {
+    JS_SELF_HOSTED_SYM_GET(species, "SharedArrayBufferSpecies", 0),
     JS_PS_END
 };
 
 static const JSFunctionSpec prototype_functions[] = {
     JS_FS_END
 };
 
 static const JSPropertySpec prototype_properties[] = {
     JS_PSG("byteLength", SharedArrayBufferObject::byteLengthGetter, 0),
+    JS_STRING_SYM_PS(toStringTag, "SharedArrayBuffer", JSPROP_READONLY),
     JS_PS_END
 };
 
 static const ClassSpec ArrayBufferObjectClassSpec = {
     GenericCreateConstructor<SharedArrayBufferObject::class_constructor, 1, gc::AllocKind::FUNCTION>,
     CreateSharedArrayBufferPrototype,
     static_functions,
     static_properties,