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

Unified Diff: src/harmony-array.js

Issue 1100673002: Wrap harmony implementations in functions. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 8 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/bootstrapper.cc ('k') | src/harmony-array-includes.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/harmony-array.js
diff --git a/src/harmony-array.js b/src/harmony-array.js
index dc7d71fcb4dca34110756793db4953325ca95b8e..18cda170549b5a21b039c5ff2aa9b024ca281272 100644
--- a/src/harmony-array.js
+++ b/src/harmony-array.js
@@ -2,11 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+(function() {
+
'use strict';
-// This file relies on the fact that the following declaration has been made
-// in runtime.js:
-// var $Array = global.Array;
+%CheckIsBootstrapping();
+
+var GlobalArray = global.Array;
+var GlobalSymbol = global.Symbol;
// -------------------------------------------------------------------
@@ -208,34 +211,24 @@ function ArrayOf() {
// -------------------------------------------------------------------
-function HarmonyArrayExtendSymbolPrototype() {
- %CheckIsBootstrapping();
-
- InstallConstants(global.Symbol, [
- // TODO(dslomov, caitp): Move to symbol.js when shipping
- "isConcatSpreadable", symbolIsConcatSpreadable
- ]);
-}
+InstallConstants(GlobalSymbol, [
+ // TODO(dslomov, caitp): Move to symbol.js when shipping
+ "isConcatSpreadable", symbolIsConcatSpreadable
+]);
-HarmonyArrayExtendSymbolPrototype();
+%FunctionSetLength(ArrayFrom, 1);
-function HarmonyArrayExtendArrayPrototype() {
- %CheckIsBootstrapping();
+// Set up non-enumerable functions on the Array object.
+InstallFunctions(GlobalArray, DONT_ENUM, [
+ "from", ArrayFrom,
+ "of", ArrayOf
+]);
- %FunctionSetLength(ArrayFrom, 1);
-
- // Set up non-enumerable functions on the Array object.
- InstallFunctions($Array, DONT_ENUM, [
- "from", ArrayFrom,
- "of", ArrayOf
- ]);
-
- // Set up the non-enumerable functions on the Array prototype object.
- InstallFunctions($Array.prototype, DONT_ENUM, [
- "find", ArrayFind,
- "findIndex", ArrayFindIndex,
- "fill", ArrayFill
- ]);
-}
+// Set up the non-enumerable functions on the Array prototype object.
+InstallFunctions(GlobalArray.prototype, DONT_ENUM, [
+ "find", ArrayFind,
+ "findIndex", ArrayFindIndex,
+ "fill", ArrayFill
+]);
-HarmonyArrayExtendArrayPrototype();
+})();
« no previous file with comments | « src/bootstrapper.cc ('k') | src/harmony-array-includes.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698