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

Unified Diff: src/harmony-array-includes.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/harmony-array.js ('k') | src/harmony-reflect.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/harmony-array-includes.js
diff --git a/src/harmony-array-includes.js b/src/harmony-array-includes.js
index d6099bd739733e0690658fabf0f4557f58bc7dae..02768750e681f2605925c6fc40cf194b7489d361 100644
--- a/src/harmony-array-includes.js
+++ b/src/harmony-array-includes.js
@@ -2,11 +2,13 @@
// 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;
// -------------------------------------------------------------------
@@ -47,15 +49,11 @@ function ArrayIncludes(searchElement, fromIndex) {
// -------------------------------------------------------------------
-function HarmonyArrayIncludesExtendArrayPrototype() {
- %CheckIsBootstrapping();
+%FunctionSetLength(ArrayIncludes, 1);
- %FunctionSetLength(ArrayIncludes, 1);
-
- // Set up the non-enumerable functions on the Array prototype object.
- InstallFunctions($Array.prototype, DONT_ENUM, [
- "includes", ArrayIncludes
- ]);
-}
+// Set up the non-enumerable functions on the Array prototype object.
+InstallFunctions(GlobalArray.prototype, DONT_ENUM, [
+ "includes", ArrayIncludes
+]);
-HarmonyArrayIncludesExtendArrayPrototype();
+})();
« no previous file with comments | « src/harmony-array.js ('k') | src/harmony-reflect.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698