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

Unified Diff: src/unscopables.js

Issue 455763002: Unship unscopables and disable array.values iterators (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Adjust BUILD.gn 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/test-unscopables-hidden-prototype.cc » ('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..fc030c68cb9f09cc7dd0c54f975bba1499d1c048
--- /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 UnscopablesExtendSymbol() {
+ %CheckIsBootstrapping();
+ InstallConstants($Symbol, $Array(
+ "unscopables", symbolUnscopables
+ ));
+}
+
+UnscopablesExtendSymbol();
+
+
+var arrayUnscopables = {
+ __proto__: null,
+ copyWithin: true,
+ entries: true,
+ fill: true,
+ find: true,
+ findIndex: true,
+ keys: true,
+ values: true,
+};
+
+
+function UnscopablesExtendArrayPrototype() {
+ %CheckIsBootstrapping();
+ %AddNamedProperty($Array.prototype, symbolUnscopables, arrayUnscopables,
+ DONT_ENUM | READ_ONLY);
+}
+
+UnscopablesExtendArrayPrototype();
« no previous file with comments | « src/symbol.js ('k') | test/cctest/test-unscopables-hidden-prototype.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698