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

Unified Diff: src/array.js

Issue 455743002: Enable ES6 unscopables (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 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 | « no previous file | src/bootstrapper.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/array.js
diff --git a/src/array.js b/src/array.js
index 60a6834198bc421b8c41c076696006680c8b82b6..cf99aceb699de5c1de52f66510f7b07f6048ba7b 100644
--- a/src/array.js
+++ b/src/array.js
@@ -1471,6 +1471,20 @@ function SetUpArray() {
// object.
%AddNamedProperty($Array.prototype, "constructor", $Array, DONT_ENUM);
+ // Set up unscopable properties on the Array.prototype object.
+ var unscopables = {
+ __proto__: null,
+ copyWithin: true,
+ entries: true,
+ fill: true,
+ find: true,
+ findIndex: true,
+ keys: true,
+ values: true,
+ };
+ %AddNamedProperty($Array.prototype, symbolUnscopables, unscopables,
+ DONT_ENUM | READ_ONLY);
+
// Set up non-enumerable functions on the Array object.
InstallFunctions($Array, DONT_ENUM, $Array(
"isArray", ArrayIsArray
« no previous file with comments | « no previous file | src/bootstrapper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698