Chromium Code Reviews| Index: src/typedarray.js |
| diff --git a/src/typedarray.js b/src/typedarray.js |
| index c149b35b98e8926094ae7054b977bc29aed2ee10..7ca2f9f0ba8646e42273357318ebc52bfddd6969 100644 |
| --- a/src/typedarray.js |
| +++ b/src/typedarray.js |
| @@ -291,6 +291,13 @@ function TypedArraySet(obj, offset) { |
| } |
| } |
| +function TypedArrayGetToStringTag() { |
| + if (!%IsTypedArray(this)) return; |
| + var name = %_ClassOf(this); |
| + if (IS_UNDEFINED(name)) return; |
| + return name; |
|
caitp (gmail)
2014/10/24 12:44:34
admittedly the above if statement doesn't really m
|
| +} |
| + |
| // ------------------------------------------------------------------- |
| function SetupTypedArrays() { |
| @@ -310,7 +317,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); |
|
Dmitry Lomov (no reviews)
2014/10/24 12:38:55
line length
|
| InstallFunctions(global.NAME.prototype, DONT_ENUM, $Array( |
| "subarray", NAMESubArray, |
| "set", TypedArraySet |
| @@ -437,6 +444,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); |