Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(410)

Side by Side Diff: Source/bindings/core/v8/ScriptController.cpp

Issue 1067763002: bindings: Use Maybe version of Get in bindings/ (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/bindings/core/v8/NPV8Object.cpp ('k') | Source/bindings/core/v8/ScriptFunctionCall.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « Source/bindings/core/v8/NPV8Object.cpp ('k') | Source/bindings/core/v8/ScriptFunctionCall.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698