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(); |