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

Unified Diff: src/factory.cc

Issue 952483002: NewError no longer returns a MaybeObject. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@reland
Patch Set: Created 5 years, 10 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/factory.h ('k') | src/isolate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/factory.cc
diff --git a/src/factory.cc b/src/factory.cc
index d823f5836631cc76b7d4dbaf0911a94c6ecc4fc7..7e801bfd145b8764a3854efbda77662da13bea97 100644
--- a/src/factory.cc
+++ b/src/factory.cc
@@ -1058,58 +1058,58 @@ Handle<HeapNumber> Factory::NewHeapNumber(double value,
}
-MaybeHandle<Object> Factory::NewTypeError(const char* message,
- Vector<Handle<Object> > args) {
+Handle<Object> Factory::NewTypeError(const char* message,
+ Vector<Handle<Object> > args) {
return NewError("MakeTypeError", message, args);
}
-MaybeHandle<Object> Factory::NewTypeError(Handle<String> message) {
+Handle<Object> Factory::NewTypeError(Handle<String> message) {
return NewError("$TypeError", message);
}
-MaybeHandle<Object> Factory::NewRangeError(const char* message,
- Vector<Handle<Object> > args) {
+Handle<Object> Factory::NewRangeError(const char* message,
+ Vector<Handle<Object> > args) {
return NewError("MakeRangeError", message, args);
}
-MaybeHandle<Object> Factory::NewRangeError(Handle<String> message) {
+Handle<Object> Factory::NewRangeError(Handle<String> message) {
return NewError("$RangeError", message);
}
-MaybeHandle<Object> Factory::NewSyntaxError(const char* message,
- Handle<JSArray> args) {
+Handle<Object> Factory::NewSyntaxError(const char* message,
+ Handle<JSArray> args) {
return NewError("MakeSyntaxError", message, args);
}
-MaybeHandle<Object> Factory::NewSyntaxError(Handle<String> message) {
+Handle<Object> Factory::NewSyntaxError(Handle<String> message) {
return NewError("$SyntaxError", message);
}
-MaybeHandle<Object> Factory::NewReferenceError(const char* message,
- Vector<Handle<Object> > args) {
+Handle<Object> Factory::NewReferenceError(const char* message,
+ Vector<Handle<Object> > args) {
return NewError("MakeReferenceError", message, args);
}
-MaybeHandle<Object> Factory::NewReferenceError(const char* message,
- Handle<JSArray> args) {
+Handle<Object> Factory::NewReferenceError(const char* message,
+ Handle<JSArray> args) {
return NewError("MakeReferenceError", message, args);
}
-MaybeHandle<Object> Factory::NewReferenceError(Handle<String> message) {
+Handle<Object> Factory::NewReferenceError(Handle<String> message) {
return NewError("$ReferenceError", message);
}
-MaybeHandle<Object> Factory::NewError(const char* maker, const char* message,
- Vector<Handle<Object> > args) {
+Handle<Object> Factory::NewError(const char* maker, const char* message,
+ Vector<Handle<Object> > args) {
// Instantiate a closeable HandleScope for EscapeFrom.
v8::EscapableHandleScope scope(reinterpret_cast<v8::Isolate*>(isolate()));
Handle<FixedArray> array = NewFixedArray(args.length());
@@ -1117,21 +1117,19 @@ MaybeHandle<Object> Factory::NewError(const char* maker, const char* message,
array->set(i, *args[i]);
}
Handle<JSArray> object = NewJSArrayWithElements(array);
- Handle<Object> result;
- ASSIGN_RETURN_ON_EXCEPTION(isolate(), result,
- NewError(maker, message, object), Object);
+ Handle<Object> result = NewError(maker, message, object);
return result.EscapeFrom(&scope);
}
-MaybeHandle<Object> Factory::NewEvalError(const char* message,
- Vector<Handle<Object> > args) {
+Handle<Object> Factory::NewEvalError(const char* message,
+ Vector<Handle<Object> > args) {
return NewError("MakeEvalError", message, args);
}
-MaybeHandle<Object> Factory::NewError(const char* message,
- Vector<Handle<Object> > args) {
+Handle<Object> Factory::NewError(const char* message,
+ Vector<Handle<Object> > args) {
return NewError("MakeError", message, args);
}
@@ -1172,8 +1170,8 @@ Handle<String> Factory::EmergencyNewError(const char* message,
}
-MaybeHandle<Object> Factory::NewError(const char* maker, const char* message,
- Handle<JSArray> args) {
+Handle<Object> Factory::NewError(const char* maker, const char* message,
+ Handle<JSArray> args) {
Handle<String> make_str = InternalizeUtf8String(maker);
Handle<Object> fun_obj = Object::GetProperty(
isolate()->js_builtins_object(), make_str).ToHandleChecked();
@@ -1203,13 +1201,13 @@ MaybeHandle<Object> Factory::NewError(const char* maker, const char* message,
}
-MaybeHandle<Object> Factory::NewError(Handle<String> message) {
+Handle<Object> Factory::NewError(Handle<String> message) {
return NewError("$Error", message);
}
-MaybeHandle<Object> Factory::NewError(const char* constructor,
- Handle<String> message) {
+Handle<Object> Factory::NewError(const char* constructor,
+ Handle<String> message) {
Handle<String> constr = InternalizeUtf8String(constructor);
Handle<JSFunction> fun = Handle<JSFunction>::cast(Object::GetProperty(
isolate()->js_builtins_object(), constr).ToHandleChecked());
« no previous file with comments | « src/factory.h ('k') | src/isolate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698