Skip to content

Commit

Permalink
chore: allow primitives through the world safe checl
Browse files Browse the repository at this point in the history
  • Loading branch information
MarshallOfSound committed Jul 13, 2020
1 parent cf96382 commit 9615819
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions shell/renderer/api/electron_api_web_frame.cc
Expand Up @@ -174,11 +174,13 @@ class ScriptExecutionCallback : public blink::WebScriptExecutionCallback {
if (!result.empty()) {
if (!result[0].IsEmpty()) {
// Either world safe results are disabled or the result was created in
// the same world as the caller
// the same world as the caller or the result is not an object and
// therefore does not have a prototype chain to protect
if (!world_safe_result_ ||
(result[0]->IsObject() &&
promise_.GetContext() ==
result[0].As<v8::Object>()->CreationContext())) {
result[0].As<v8::Object>()->CreationContext()) ||
!result[0]->IsObject()) {
// Right now only single results per frame is supported.
if (!callback_.is_null())
std::move(callback_).Run(result[0], v8::Undefined(isolate));
Expand Down

0 comments on commit 9615819

Please sign in to comment.