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