| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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, extrasUtils) { | 5 (function(global, utils, extrasUtils) { |
| 6 | 6 |
| 7 "use strict"; | 7 "use strict"; |
| 8 | 8 |
| 9 %CheckIsBootstrapping(); | 9 %CheckIsBootstrapping(); |
| 10 | 10 |
| (...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 utils.OverrideFunction = OverrideFunction; | 259 utils.OverrideFunction = OverrideFunction; |
| 260 utils.SetUpLockedPrototype = SetUpLockedPrototype; | 260 utils.SetUpLockedPrototype = SetUpLockedPrototype; |
| 261 utils.PostNatives = PostNatives; | 261 utils.PostNatives = PostNatives; |
| 262 utils.PostExperimentals = PostExperimentals; | 262 utils.PostExperimentals = PostExperimentals; |
| 263 utils.PostDebug = PostDebug; | 263 utils.PostDebug = PostDebug; |
| 264 | 264 |
| 265 %ToFastProperties(utils); | 265 %ToFastProperties(utils); |
| 266 | 266 |
| 267 // ----------------------------------------------------------------------- | 267 // ----------------------------------------------------------------------- |
| 268 | 268 |
| 269 %OptimizeObjectForAddingMultipleProperties(extrasUtils, 5); | 269 %OptimizeObjectForAddingMultipleProperties(extrasUtils, 7); |
| 270 | 270 |
| 271 extrasUtils.logStackTrace = function logStackTrace() { | 271 extrasUtils.logStackTrace = function logStackTrace() { |
| 272 %DebugTrace(); | 272 %DebugTrace(); |
| 273 }; | 273 }; |
| 274 | 274 |
| 275 extrasUtils.log = function log() { | 275 extrasUtils.log = function log() { |
| 276 let message = ''; | 276 let message = ''; |
| 277 for (const arg of arguments) { | 277 for (const arg of arguments) { |
| 278 message += arg; | 278 message += arg; |
| 279 } | 279 } |
| (...skipping 20 matching lines...) Expand all Loading... |
| 300 return %reflect_apply(func, thisArg, args); | 300 return %reflect_apply(func, thisArg, args); |
| 301 }; | 301 }; |
| 302 }; | 302 }; |
| 303 | 303 |
| 304 extrasUtils.uncurryThis = function uncurryThis(func) { | 304 extrasUtils.uncurryThis = function uncurryThis(func) { |
| 305 return function(thisArg, ...args) { | 305 return function(thisArg, ...args) { |
| 306 return %reflect_apply(func, thisArg, args); | 306 return %reflect_apply(func, thisArg, args); |
| 307 }; | 307 }; |
| 308 }; | 308 }; |
| 309 | 309 |
| 310 // We pass true to trigger the debugger's on exception handler. |
| 311 extrasUtils.rejectPromise = function rejectPromise(promise, reason) { |
| 312 %promise_internal_reject(promise, reason, true); |
| 313 } |
| 314 |
| 315 extrasUtils.markPromiseAsHandled = function markPromiseAsHandled(promise) { |
| 316 %PromiseMarkAsHandled(promise); |
| 317 }; |
| 318 |
| 310 %ToFastProperties(extrasUtils); | 319 %ToFastProperties(extrasUtils); |
| 311 | 320 |
| 312 }) | 321 }) |
| OLD | NEW |