| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007-2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2007-2011 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 361 return; | 361 return; |
| 362 } | 362 } |
| 363 | 363 |
| 364 ASSERT(isolate->InContext()); | 364 ASSERT(isolate->InContext()); |
| 365 v8::TryCatch tryCatch; | 365 v8::TryCatch tryCatch; |
| 366 v8::Handle<v8::Value> result = V8ScriptRunner::compileAndRunInternalScript(e
xpression, info.GetIsolate()); | 366 v8::Handle<v8::Value> result = V8ScriptRunner::compileAndRunInternalScript(e
xpression, info.GetIsolate()); |
| 367 | 367 |
| 368 v8::Local<v8::Object> wrappedResult = v8::Object::New(isolate); | 368 v8::Local<v8::Object> wrappedResult = v8::Object::New(isolate); |
| 369 if (tryCatch.HasCaught()) { | 369 if (tryCatch.HasCaught()) { |
| 370 wrappedResult->Set(v8::String::NewFromUtf8(isolate, "result"), tryCatch.
Exception()); | 370 wrappedResult->Set(v8::String::NewFromUtf8(isolate, "result"), tryCatch.
Exception()); |
| 371 wrappedResult->Set(v8::String::NewFromUtf8(isolate, "exceptionDetails"),
JavaScriptCallFrame::createExceptionDetails(tryCatch.Message(), isolate)); | 371 wrappedResult->Set(v8::String::NewFromUtf8(isolate, "exceptionDetails"),
JavaScriptCallFrame::createExceptionDetails(isolate, tryCatch.Message())); |
| 372 } else { | 372 } else { |
| 373 wrappedResult->Set(v8::String::NewFromUtf8(isolate, "result"), result); | 373 wrappedResult->Set(v8::String::NewFromUtf8(isolate, "result"), result); |
| 374 wrappedResult->Set(v8::String::NewFromUtf8(isolate, "exceptionDetails"),
v8::Undefined(isolate)); | 374 wrappedResult->Set(v8::String::NewFromUtf8(isolate, "exceptionDetails"),
v8::Undefined(isolate)); |
| 375 } | 375 } |
| 376 v8SetReturnValue(info, wrappedResult); | 376 v8SetReturnValue(info, wrappedResult); |
| 377 } | 377 } |
| 378 | 378 |
| 379 void V8InjectedScriptHost::setFunctionVariableValueMethodCustom(const v8::Functi
onCallbackInfo<v8::Value>& info) | 379 void V8InjectedScriptHost::setFunctionVariableValueMethodCustom(const v8::Functi
onCallbackInfo<v8::Value>& info) |
| 380 { | 380 { |
| 381 if (info.Length() < 4 || !info[0]->IsFunction() || !info[1]->IsInt32() || !i
nfo[2]->IsString()) | 381 if (info.Length() < 4 || !info[0]->IsFunction() || !info[1]->IsInt32() || !i
nfo[2]->IsString()) |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 505 void V8InjectedScriptHost::setNonEnumPropertyMethodCustom(const v8::FunctionCall
backInfo<v8::Value>& info) | 505 void V8InjectedScriptHost::setNonEnumPropertyMethodCustom(const v8::FunctionCall
backInfo<v8::Value>& info) |
| 506 { | 506 { |
| 507 if (info.Length() < 3 || !info[0]->IsObject() || !info[1]->IsString()) | 507 if (info.Length() < 3 || !info[0]->IsObject() || !info[1]->IsString()) |
| 508 return; | 508 return; |
| 509 | 509 |
| 510 v8::Local<v8::Object> object = info[0]->ToObject(info.GetIsolate()); | 510 v8::Local<v8::Object> object = info[0]->ToObject(info.GetIsolate()); |
| 511 object->ForceSet(info[1], info[2], v8::DontEnum); | 511 object->ForceSet(info[1], info[2], v8::DontEnum); |
| 512 } | 512 } |
| 513 | 513 |
| 514 } // namespace blink | 514 } // namespace blink |
| OLD | NEW |