Index: extensions/renderer/module_system.cc |
diff --git a/extensions/renderer/module_system.cc b/extensions/renderer/module_system.cc |
index 1e121051e767869bf0689ae4fc8c06276289edec..270e5426b10b73844f0a3d1bc0302ac36912a655 100644 |
--- a/extensions/renderer/module_system.cc |
+++ b/extensions/renderer/module_system.cc |
@@ -563,8 +563,14 @@ v8::Handle<v8::String> ModuleSystem::WrapSource(v8::Handle<v8::String> source) { |
void ModuleSystem::Private(const v8::FunctionCallbackInfo<v8::Value>& args) { |
CHECK_EQ(1, args.Length()); |
- CHECK(args[0]->IsObject()); |
- CHECK(!args[0]->IsNull()); |
+ if (!args[0]->IsObject() || args[0]->IsNull()) { |
+ GetIsolate()->ThrowException(v8::Exception::TypeError( |
+ args[0]->IsUndefined() ? |
not at google - send to devlin
2014/12/08 22:48:11
I think the ternary here looks pretty weird. I had
robwu
2014/12/08 22:51:27
Would it help if I put the ? and : at the start of
robwu
2014/12/08 23:08:38
Done (I put ? and : in front of the line and ran g
|
+ "Method called without a valid receiver (this)." |
+ "Did you forget to call .bind()?" : |
+ "Invalid invocation: this is not an object!")); |
+ return; |
+ } |
v8::Local<v8::Object> obj = args[0].As<v8::Object>(); |
v8::Local<v8::String> privates_key = |
v8::String::NewFromUtf8(GetIsolate(), "privates"); |