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

Unified Diff: src/unscopables.js

Issue 384963002: ES6 Unscopables (Closed) Base URL: http://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 | « src/symbol.js ('k') | test/cctest/cctest.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/unscopables.js
diff --git a/src/unscopables.js b/src/unscopables.js
new file mode 100644
index 0000000000000000000000000000000000000000..0d70ac683f3200bc68881e47ad6f9eea8ab62fb4
--- /dev/null
+++ b/src/unscopables.js
@@ -0,0 +1,39 @@
+// Copyright 2014 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+'use strict';
+
+// This file relies on the fact that the following declaration has been made.
+// var $Array = global.Array;
+// var $Symbol = global.Symbol;
+
+function ExtendSymbol() {
+ %CheckIsBootstrapping();
+ InstallConstants($Symbol, $Array(
+ "unscopables", symbolUnscopables
+ ));
+}
+
+ExtendSymbol();
+
+
+var arrayUnscopables = {
+ __proto__: null,
+ copyWithin: true,
+ entries: true,
+ fill: true,
+ find: true,
+ findIndex: true,
+ keys: true,
+ values: true,
+};
+
+
+function ExtendArrayPrototype() {
+ %CheckIsBootstrapping();
+ %AddNamedProperty($Array.prototype, symbolUnscopables, arrayUnscopables,
+ DONT_ENUM | READ_ONLY);
+}
+
+ExtendArrayPrototype();
« no previous file with comments | « src/symbol.js ('k') | test/cctest/cctest.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698