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

Side by Side Diff: src/js/promise.js

Issue 1578893002: Partial rollback of Promise error checking (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add failing ignition test Created 4 years, 11 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 | « no previous file | test/mjsunit/mjsunit.status » ('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, extrasUtils) { 5 (function(global, utils, extrasUtils) {
6 6
7 "use strict"; 7 "use strict";
8 8
9 %CheckIsBootstrapping(); 9 %CheckIsBootstrapping();
10 10
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 } 230 }
231 231
232 var result = {promise: UNDEFINED, resolve: UNDEFINED, reject: UNDEFINED }; 232 var result = {promise: UNDEFINED, resolve: UNDEFINED, reject: UNDEFINED };
233 result.promise = new C((resolve, reject) => { 233 result.promise = new C((resolve, reject) => {
234 if (!IS_UNDEFINED(result.resolve) || !IS_UNDEFINED(result.reject)) 234 if (!IS_UNDEFINED(result.resolve) || !IS_UNDEFINED(result.reject))
235 throw MakeTypeError(kPromiseExecutorAlreadyInvoked); 235 throw MakeTypeError(kPromiseExecutorAlreadyInvoked);
236 result.resolve = resolve; 236 result.resolve = resolve;
237 result.reject = reject; 237 result.reject = reject;
238 }); 238 });
239 239
240 if (!IS_CALLABLE(result.resolve))
241 throw MakeTypeError(kCalledNonCallable, "promiseCapability.[[Resolve]]");
242 if (!IS_CALLABLE(result.reject))
243 throw MakeTypeError(kCalledNonCallable, "promiseCapability.[[Reject]]");
244
245 return result; 240 return result;
246 } 241 }
247 242
248 function PromiseDeferred() { 243 function PromiseDeferred() {
249 %IncrementUseCounter(kPromiseDefer); 244 %IncrementUseCounter(kPromiseDefer);
250 return NewPromiseCapability(this); 245 return NewPromiseCapability(this);
251 } 246 }
252 247
253 function PromiseResolved(x) { 248 function PromiseResolved(x) {
254 %IncrementUseCounter(kPromiseAccept); 249 %IncrementUseCounter(kPromiseAccept);
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
475 [PromiseChain, PromiseDeferred, PromiseResolved].forEach( 470 [PromiseChain, PromiseDeferred, PromiseResolved].forEach(
476 fn => %FunctionRemovePrototype(fn)); 471 fn => %FunctionRemovePrototype(fn));
477 472
478 utils.Export(function(to) { 473 utils.Export(function(to) {
479 to.PromiseChain = PromiseChain; 474 to.PromiseChain = PromiseChain;
480 to.PromiseDeferred = PromiseDeferred; 475 to.PromiseDeferred = PromiseDeferred;
481 to.PromiseResolved = PromiseResolved; 476 to.PromiseResolved = PromiseResolved;
482 }); 477 });
483 478
484 }) 479 })
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/mjsunit.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698