| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008, 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2008, 2009 Google Inc. All rights reserved. |
| 3 * Copyright (C) 2009 Apple Inc. All rights reserved. | 3 * Copyright (C) 2009 Apple Inc. All rights reserved. |
| 4 * Copyright (C) 2014 Opera Software ASA. All rights reserved. | 4 * Copyright (C) 2014 Opera Software ASA. All rights reserved. |
| 5 * | 5 * |
| 6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
| 7 * modification, are permitted provided that the following conditions are | 7 * modification, are permitted provided that the following conditions are |
| 8 * met: | 8 * met: |
| 9 * | 9 * |
| 10 * * Redistributions of source code must retain the above copyright | 10 * * Redistributions of source code must retain the above copyright |
| (...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 414 return; | 414 return; |
| 415 | 415 |
| 416 ScriptState* scriptState = isolatedWorldWindowProxy->getScriptState(); | 416 ScriptState* scriptState = isolatedWorldWindowProxy->getScriptState(); |
| 417 v8::Context::Scope scope(scriptState->context()); | 417 v8::Context::Scope scope(scriptState->context()); |
| 418 v8::Local<v8::Array> resultArray = v8::Array::New(isolate(), sources.size())
; | 418 v8::Local<v8::Array> resultArray = v8::Array::New(isolate(), sources.size())
; |
| 419 | 419 |
| 420 for (size_t i = 0; i < sources.size(); ++i) { | 420 for (size_t i = 0; i < sources.size(); ++i) { |
| 421 v8::Local<v8::Value> evaluationResult = executeScriptAndReturnValue(scri
ptState->context(), sources[i]); | 421 v8::Local<v8::Value> evaluationResult = executeScriptAndReturnValue(scri
ptState->context(), sources[i]); |
| 422 if (evaluationResult.IsEmpty()) | 422 if (evaluationResult.IsEmpty()) |
| 423 evaluationResult = v8::Local<v8::Value>::New(isolate(), v8::Undefine
d(isolate())); | 423 evaluationResult = v8::Local<v8::Value>::New(isolate(), v8::Undefine
d(isolate())); |
| 424 if (!v8CallBoolean(resultArray->Set(scriptState->context(), v8::Integer:
:New(scriptState->isolate(), i), evaluationResult))) | 424 if (!v8CallBoolean(resultArray->CreateDataProperty(scriptState->context(
), i, evaluationResult))) |
| 425 return; | 425 return; |
| 426 } | 426 } |
| 427 | 427 |
| 428 if (results) { | 428 if (results) { |
| 429 for (size_t i = 0; i < resultArray->Length(); ++i) { | 429 for (size_t i = 0; i < resultArray->Length(); ++i) { |
| 430 v8::Local<v8::Value> value; | 430 v8::Local<v8::Value> value; |
| 431 if (!resultArray->Get(scriptState->context(), i).ToLocal(&value)) | 431 if (!resultArray->Get(scriptState->context(), i).ToLocal(&value)) |
| 432 return; | 432 return; |
| 433 results->append(value); | 433 results->append(value); |
| 434 } | 434 } |
| 435 } | 435 } |
| 436 } | 436 } |
| 437 | 437 |
| 438 } // namespace blink | 438 } // namespace blink |
| OLD | NEW |