Index: src/factory.cc |
diff --git a/src/factory.cc b/src/factory.cc |
index 43c0f8aac780d007b07a076a906458f8fa3aaefc..de47c849480634bb8560a5289cf5e5f2cdd46ecd 100644 |
--- a/src/factory.cc |
+++ b/src/factory.cc |
@@ -1250,18 +1250,15 @@ Handle<Object> Factory::NewError(const char* maker, const char* message, |
} |
-Handle<Object> Factory::NewError(const char* constructor, |
+Handle<Object> Factory::NewError(Handle<JSFunction> constructor, |
Handle<String> message) { |
- Handle<String> constr = InternalizeUtf8String(constructor); |
- Handle<JSFunction> fun = Handle<JSFunction>::cast(Object::GetProperty( |
- isolate()->js_builtins_object(), constr).ToHandleChecked()); |
Handle<Object> argv[] = { message }; |
// Invoke the JavaScript factory method. If an exception is thrown while |
// running the factory method, use the exception as the result. |
Handle<Object> result; |
MaybeHandle<Object> exception; |
- if (!Execution::TryCall(fun, undefined_value(), arraysize(argv), argv, |
+ if (!Execution::TryCall(constructor, undefined_value(), arraysize(argv), argv, |
&exception) |
.ToHandle(&result)) { |
Handle<Object> exception_obj; |