OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 var $promiseCreate; | 5 var $promiseCreate; |
6 var $promiseResolve; | 6 var $promiseResolve; |
7 var $promiseReject; | 7 var $promiseReject; |
8 var $promiseChain; | 8 var $promiseChain; |
9 var $promiseCatch; | 9 var $promiseCatch; |
10 var $promiseThen; | 10 var $promiseThen; |
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
364 return PromiseHasUserDefinedRejectHandlerRecursive(this); | 364 return PromiseHasUserDefinedRejectHandlerRecursive(this); |
365 }; | 365 }; |
366 | 366 |
367 // ------------------------------------------------------------------- | 367 // ------------------------------------------------------------------- |
368 // Install exported functions. | 368 // Install exported functions. |
369 | 369 |
370 %AddNamedProperty(global, 'Promise', GlobalPromise, DONT_ENUM); | 370 %AddNamedProperty(global, 'Promise', GlobalPromise, DONT_ENUM); |
371 %AddNamedProperty(GlobalPromise.prototype, symbolToStringTag, "Promise", | 371 %AddNamedProperty(GlobalPromise.prototype, symbolToStringTag, "Promise", |
372 DONT_ENUM | READ_ONLY); | 372 DONT_ENUM | READ_ONLY); |
373 | 373 |
374 utils.InstallFunctions(GlobalPromise, DONT_ENUM, [ | 374 $installFunctions(GlobalPromise, DONT_ENUM, [ |
375 "defer", PromiseDeferred, | 375 "defer", PromiseDeferred, |
376 "accept", PromiseResolved, | 376 "accept", PromiseResolved, |
377 "reject", PromiseRejected, | 377 "reject", PromiseRejected, |
378 "all", PromiseAll, | 378 "all", PromiseAll, |
379 "race", PromiseRace, | 379 "race", PromiseRace, |
380 "resolve", PromiseCast | 380 "resolve", PromiseCast |
381 ]); | 381 ]); |
382 | 382 |
383 utils.InstallFunctions(GlobalPromise.prototype, DONT_ENUM, [ | 383 $installFunctions(GlobalPromise.prototype, DONT_ENUM, [ |
384 "chain", PromiseChain, | 384 "chain", PromiseChain, |
385 "then", PromiseThen, | 385 "then", PromiseThen, |
386 "catch", PromiseCatch | 386 "catch", PromiseCatch |
387 ]); | 387 ]); |
388 | 388 |
389 $promiseCreate = PromiseCreate; | 389 $promiseCreate = PromiseCreate; |
390 $promiseResolve = PromiseResolve; | 390 $promiseResolve = PromiseResolve; |
391 $promiseReject = PromiseReject; | 391 $promiseReject = PromiseReject; |
392 $promiseChain = PromiseChain; | 392 $promiseChain = PromiseChain; |
393 $promiseCatch = PromiseCatch; | 393 $promiseCatch = PromiseCatch; |
394 $promiseThen = PromiseThen; | 394 $promiseThen = PromiseThen; |
395 $promiseHasUserDefinedRejectHandler = PromiseHasUserDefinedRejectHandler; | 395 $promiseHasUserDefinedRejectHandler = PromiseHasUserDefinedRejectHandler; |
396 $promiseStatus = promiseStatus; | 396 $promiseStatus = promiseStatus; |
397 $promiseValue = promiseValue; | 397 $promiseValue = promiseValue; |
398 | 398 |
399 }) | 399 }) |
OLD | NEW |