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

Unified Diff: src/typedarray.js

Issue 1318043002: Native context: do not put public symbols and flags on the js builtins object. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix and rebase Created 5 years, 4 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/symbol.js ('k') | src/v8natives.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 d1f7ed1fdb0caf35fc16b0982a4f35e1a32277fb..416fd689a2f13edd4691a46fbf61c7f5d184e516 100644
--- a/src/typedarray.js
+++ b/src/typedarray.js
@@ -15,6 +15,8 @@ var GlobalArray = global.Array;
var GlobalArrayBuffer = global.ArrayBuffer;
var GlobalDataView = global.DataView;
var GlobalObject = global.Object;
+var iteratorSymbol = utils.ImportNow("iterator_symbol");
+var toStringTagSymbol = utils.ImportNow("to_string_tag_symbol");
macro TYPED_ARRAYS(FUNCTION)
// arrayIds below should be synchronized with Runtime_TypedArrayInitialize.
@@ -147,7 +149,7 @@ function NAMEConstructByIterable(obj, iterable, iteratorFn) {
};
// TODO(littledan): Computed properties don't work yet in nosnap.
// Rephrase when they do.
- newIterable[symbolIterator] = function() { return iterator; }
+ newIterable[iteratorSymbol] = function() { return iterator; }
for (var value of newIterable) {
list.push(value);
}
@@ -162,7 +164,7 @@ function NAMEConstructor(arg1, arg2, arg3) {
IS_BOOLEAN(arg1) || IS_UNDEFINED(arg1)) {
NAMEConstructByLength(this, arg1);
} else {
- var iteratorFn = arg1[symbolIterator];
+ var iteratorFn = arg1[iteratorSymbol];
if (IS_UNDEFINED(iteratorFn) || iteratorFn === $arrayValues) {
NAMEConstructByArrayLike(this, arg1);
} else {
@@ -368,7 +370,7 @@ macro SETUP_TYPED_ARRAY(ARRAY_ID, NAME, ELEMENT_SIZE)
DONT_ENUM | DONT_DELETE);
utils.InstallGetter(GlobalNAME.prototype, "length", NAME_GetLength,
DONT_ENUM | DONT_DELETE);
- utils.InstallGetter(GlobalNAME.prototype, symbolToStringTag,
+ utils.InstallGetter(GlobalNAME.prototype, toStringTagSymbol,
TypedArrayGetToStringTag);
utils.InstallFunctions(GlobalNAME.prototype, DONT_ENUM, [
"subarray", NAMESubArray,
@@ -474,7 +476,7 @@ DATA_VIEW_TYPES(DATA_VIEW_GETTER_SETTER)
// Set up constructor property on the DataView prototype.
%AddNamedProperty(GlobalDataView.prototype, "constructor", GlobalDataView,
DONT_ENUM);
-%AddNamedProperty(GlobalDataView.prototype, symbolToStringTag, "DataView",
+%AddNamedProperty(GlobalDataView.prototype, toStringTagSymbol, "DataView",
READ_ONLY|DONT_ENUM);
utils.InstallGetter(GlobalDataView.prototype, "buffer", DataViewGetBufferJS);
« no previous file with comments | « src/symbol.js ('k') | src/v8natives.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698