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 569 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
580 v8::Local<v8::Array> resultArray = v8::Array::New(isolate(), sources.size())
; | 580 v8::Local<v8::Array> resultArray = v8::Array::New(isolate(), sources.size())
; |
581 | 581 |
582 for (size_t i = 0; i < sources.size(); ++i) { | 582 for (size_t i = 0; i < sources.size(); ++i) { |
583 v8::Local<v8::Value> evaluationResult = executeScriptAndReturnValue(scri
ptState->context(), sources[i]); | 583 v8::Local<v8::Value> evaluationResult = executeScriptAndReturnValue(scri
ptState->context(), sources[i]); |
584 if (evaluationResult.IsEmpty()) | 584 if (evaluationResult.IsEmpty()) |
585 evaluationResult = v8::Local<v8::Value>::New(isolate(), v8::Undefine
d(isolate())); | 585 evaluationResult = v8::Local<v8::Value>::New(isolate(), v8::Undefine
d(isolate())); |
586 resultArray->Set(i, evaluationResult); | 586 resultArray->Set(i, evaluationResult); |
587 } | 587 } |
588 | 588 |
589 if (results) { | 589 if (results) { |
590 for (size_t i = 0; i < resultArray->Length(); ++i) | 590 for (size_t i = 0; i < resultArray->Length(); ++i) { |
591 results->append(resultArray->Get(i)); | 591 v8::Local<v8::Value> value; |
| 592 if (!resultArray->Get(scriptState->context(), i).ToLocal(&value)) |
| 593 return; |
| 594 results->append(value); |
| 595 } |
592 } | 596 } |
593 } | 597 } |
594 | 598 |
595 } // namespace blink | 599 } // namespace blink |
OLD | NEW |