Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(439)

Unified Diff: src/typedarray.js

Issue 664333003: Add remaining @@toStringTag symbols to builtins (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Make heap-snapshot-generator not explode Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/string-iterator.js ('k') | test/mjsunit/es6/array-iterator.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/typedarray.js
diff --git a/src/typedarray.js b/src/typedarray.js
index c149b35b98e8926094ae7054b977bc29aed2ee10..4420bce4bc8dd8a2acc5740095e5f8e9d7ef323b 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;
+}
+
// -------------------------------------------------------------------
function SetupTypedArrays() {
@@ -310,7 +317,8 @@ 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);
« no previous file with comments | « src/string-iterator.js ('k') | test/mjsunit/es6/array-iterator.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698