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

Side by Side Diff: src/promise.js

Issue 1325573004: [runtime] Replace many buggy uses of %_CallFunction with %_Call. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address feedback. Created 5 years, 3 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 unified diff | Download patch
« no previous file with comments | « src/object-observe.js ('k') | src/runtime.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 (function(global, utils) { 5 (function(global, utils) {
6 6
7 "use strict"; 7 "use strict";
8 8
9 %CheckIsBootstrapping(); 9 %CheckIsBootstrapping();
10 10
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 if (!IsPromise(x) && IS_SPEC_OBJECT(x)) { 81 if (!IsPromise(x) && IS_SPEC_OBJECT(x)) {
82 var then; 82 var then;
83 try { 83 try {
84 then = x.then; 84 then = x.then;
85 } catch(r) { 85 } catch(r) {
86 return %_CallFunction(constructor, r, PromiseRejected); 86 return %_CallFunction(constructor, r, PromiseRejected);
87 } 87 }
88 if (IS_CALLABLE(then)) { 88 if (IS_CALLABLE(then)) {
89 var deferred = %_CallFunction(constructor, PromiseDeferred); 89 var deferred = %_CallFunction(constructor, PromiseDeferred);
90 try { 90 try {
91 %_CallFunction(x, deferred.resolve, deferred.reject, then); 91 %_Call(then, x, deferred.resolve, deferred.reject);
92 } catch(r) { 92 } catch(r) {
93 deferred.reject(r); 93 deferred.reject(r);
94 } 94 }
95 return deferred.promise; 95 return deferred.promise;
96 } 96 }
97 } 97 }
98 return x; 98 return x;
99 } 99 }
100 100
101 function PromiseHandle(value, handler, deferred) { 101 function PromiseHandle(value, handler, deferred) {
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
382 "promise_catch", PromiseCatch, 382 "promise_catch", PromiseCatch,
383 "promise_chain", PromiseChain, 383 "promise_chain", PromiseChain,
384 "promise_create", PromiseCreate, 384 "promise_create", PromiseCreate,
385 "promise_has_user_defined_reject_handler", PromiseHasUserDefinedRejectHandler, 385 "promise_has_user_defined_reject_handler", PromiseHasUserDefinedRejectHandler,
386 "promise_reject", PromiseReject, 386 "promise_reject", PromiseReject,
387 "promise_resolve", PromiseResolve, 387 "promise_resolve", PromiseResolve,
388 "promise_then", PromiseThen, 388 "promise_then", PromiseThen,
389 ]); 389 ]);
390 390
391 }) 391 })
OLDNEW
« no previous file with comments | « src/object-observe.js ('k') | src/runtime.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698