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

Unified Diff: src/promise.js

Issue 1118273004: Migrate error messages, part 8. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/messages.js ('k') | src/proxy.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/promise.js
diff --git a/src/promise.js b/src/promise.js
index b798fb9faf270ce8dd78111d4f3ad6badc3f8faf..630de4c85a67c34c505eb2874752e416c11d9035 100644
--- a/src/promise.js
+++ b/src/promise.js
@@ -31,9 +31,9 @@ var lastMicrotaskId = 0;
var GlobalPromise = function Promise(resolver) {
if (resolver === promiseRaw) return;
- if (!%_IsConstructCall()) throw MakeTypeError('not_a_promise', [this]);
+ if (!%_IsConstructCall()) throw MakeTypeError(kNotAPromise, this);
if (!IS_SPEC_FUNCTION(resolver))
- throw MakeTypeError('resolver_not_a_function', [resolver]);
+ throw MakeTypeError(kResolverNotAFunction, resolver);
var promise = PromiseInit(this);
try {
%DebugPushPromise(promise, Promise);
@@ -106,7 +106,7 @@ function PromiseHandle(value, handler, deferred) {
DEBUG_PREPARE_STEP_IN_IF_STEPPING(handler);
var result = handler(value);
if (result === deferred.promise)
- throw MakeTypeError('promise_cyclic', [result]);
+ throw MakeTypeError(kPromiseCyclic, result);
else if (IsPromise(result))
%_CallFunction(result, deferred.resolve, deferred.reject, PromiseChain);
else
@@ -224,7 +224,7 @@ function PromiseChain(onResolve, onReject) { // a.k.a. flatMap
var deferred = %_CallFunction(this.constructor, PromiseDeferred);
switch (GET_PRIVATE(this, promiseStatus)) {
case UNDEFINED:
- throw MakeTypeError('not_a_promise', [this]);
+ throw MakeTypeError(kNotAPromise, this);
case 0: // Pending
GET_PRIVATE(this, promiseOnResolve).push(onResolve, deferred);
GET_PRIVATE(this, promiseOnReject).push(onReject, deferred);
@@ -272,7 +272,7 @@ function PromiseThen(onResolve, onReject) {
x = PromiseCoerce(constructor, x);
if (x === that) {
DEBUG_PREPARE_STEP_IN_IF_STEPPING(onReject);
- return onReject(MakeTypeError('promise_cyclic', [x]));
+ return onReject(MakeTypeError(kPromiseCyclic, x));
} else if (IsPromise(x)) {
return x.then(onResolve, onReject);
} else {
« no previous file with comments | « src/messages.js ('k') | src/proxy.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698