| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 (function(global, utils) { | 5 (function(global, utils) { |
| 6 | 6 |
| 7 'use strict'; | 7 'use strict'; |
| 8 | 8 |
| 9 %CheckIsBootstrapping(); | 9 %CheckIsBootstrapping(); |
| 10 | 10 |
| 11 // ------------------------------------------------------------------- |
| 12 // Imports |
| 13 |
| 11 var GlobalArray = global.Array; | 14 var GlobalArray = global.Array; |
| 15 var MakeTypeError; |
| 12 var SameValueZero; | 16 var SameValueZero; |
| 13 | 17 |
| 14 utils.Import(function(from) { | 18 utils.Import(function(from) { |
| 19 MakeTypeError = from.MakeTypeError; |
| 15 SameValueZero = from.SameValueZero; | 20 SameValueZero = from.SameValueZero; |
| 16 }); | 21 }); |
| 17 | 22 |
| 18 // ------------------------------------------------------------------- | 23 // ------------------------------------------------------------------- |
| 19 | 24 |
| 20 // Proposed for ES7 | 25 // Proposed for ES7 |
| 21 // https://github.com/tc39/Array.prototype.includes | 26 // https://github.com/tc39/Array.prototype.includes |
| 22 // 46c7532ec8499dea3e51aeb940d09e07547ed3f5 | 27 // 46c7532ec8499dea3e51aeb940d09e07547ed3f5 |
| 23 function InnerArrayIncludes(searchElement, fromIndex, array, length) { | 28 function InnerArrayIncludes(searchElement, fromIndex, array, length) { |
| 24 if (length === 0) { | 29 if (length === 0) { |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 // Set up non-enumerable functions on the prototype object. | 109 // Set up non-enumerable functions on the prototype object. |
| 105 utils.InstallFunctions(GlobalNAME.prototype, DONT_ENUM, [ | 110 utils.InstallFunctions(GlobalNAME.prototype, DONT_ENUM, [ |
| 106 "includes", TypedArrayIncludes | 111 "includes", TypedArrayIncludes |
| 107 ]); | 112 ]); |
| 108 endmacro | 113 endmacro |
| 109 | 114 |
| 110 TYPED_ARRAYS(DECLARE_GLOBALS) | 115 TYPED_ARRAYS(DECLARE_GLOBALS) |
| 111 TYPED_ARRAYS(EXTEND_TYPED_ARRAY) | 116 TYPED_ARRAYS(EXTEND_TYPED_ARRAY) |
| 112 | 117 |
| 113 }) | 118 }) |
| OLD | NEW |