Chromium Code Reviews| Index: src/typedarray.js |
| diff --git a/src/typedarray.js b/src/typedarray.js |
| index c149b35b98e8926094ae7054b977bc29aed2ee10..2f2495937fab9d34e9b17290c042965e63dee711 100644 |
| --- a/src/typedarray.js |
| +++ b/src/typedarray.js |
| @@ -291,9 +291,17 @@ function TypedArraySet(obj, offset) { |
| } |
| } |
| +function TypedArrayGetToStringTag() { |
| + if (!%IsTypedArray(this)) return; |
| + var name = %_ClassOf(this); |
| + if (IS_UNDEFINED(name)) return; |
| + return name; |
| +} |
| + |
| // ------------------------------------------------------------------- |
| function SetupTypedArrays() { |
| + //TypedArrayGetToStringTag |
|
Dmitry Lomov (no reviews)
2014/10/24 08:20:48
Stray comment?
|
| macro SETUP_TYPED_ARRAY(ARRAY_ID, NAME, ELEMENT_SIZE) |
| %CheckIsBootstrapping(); |
| %SetCode(global.NAME, NAMEConstructor); |
| @@ -310,7 +318,7 @@ macro SETUP_TYPED_ARRAY(ARRAY_ID, NAME, ELEMENT_SIZE) |
| InstallGetter(global.NAME.prototype, "byteOffset", NAME_GetByteOffset); |
| InstallGetter(global.NAME.prototype, "byteLength", NAME_GetByteLength); |
| InstallGetter(global.NAME.prototype, "length", NAME_GetLength); |
| - |
| + InstallGetter(global.NAME.prototype, symbolToStringTag, TypedArrayGetToStringTag); |
| InstallFunctions(global.NAME.prototype, DONT_ENUM, $Array( |
| "subarray", NAMESubArray, |
| "set", TypedArraySet |
| @@ -437,6 +445,8 @@ function SetupDataView() { |
| // Set up constructor property on the DataView prototype. |
| %AddNamedProperty($DataView.prototype, "constructor", $DataView, DONT_ENUM); |
| + %AddNamedProperty( |
| + $DataView.prototype, symbolToStringTag, "DataView", READ_ONLY|DONT_ENUM); |
| InstallGetter($DataView.prototype, "buffer", DataViewGetBufferJS); |
| InstallGetter($DataView.prototype, "byteOffset", DataViewGetByteOffset); |