summaryrefslogtreecommitdiffstats
path: root/extensions/renderer
diff options
context:
space:
mode:
authorjochen <jochen@chromium.org>2015-12-11 02:29:49 -0800
committerCommit bot <commit-bot@chromium.org>2015-12-11 10:31:31 +0000
commit37ec8f49dfa32250bf46c8e3e91833e599e93655 (patch)
tree617bec7a8f4b9f1a6c42fde0306dd8ee5c07409a /extensions/renderer
parentf88ad81a8d3ea4ed891df31f761e721a2a522e69 (diff)
downloadchromium_src-37ec8f49dfa32250bf46c8e3e91833e599e93655.zip
chromium_src-37ec8f49dfa32250bf46c8e3e91833e599e93655.tar.gz
chromium_src-37ec8f49dfa32250bf46c8e3e91833e599e93655.tar.bz2
Replace v8::Object::ForceSet with DefineOwnProperty
In the cases where ForceSet works, but DefineOwnProperty does not, we actually break v8's object model, and further access will cause undefined behavior. According to tests, however, there is no observable differnce, and ForceSet is slated for being removed. BUG=none R=rdevlin.cronin@chromium.org,haraken@chromium.org,verwaest@chromium.org Review URL: https://codereview.chromium.org/1512753005 Cr-Commit-Position: refs/heads/master@{#364660}
Diffstat (limited to 'extensions/renderer')
-rw-r--r--extensions/renderer/module_system.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/extensions/renderer/module_system.cc b/extensions/renderer/module_system.cc
index 8bc983e..a2379ea 100644
--- a/extensions/renderer/module_system.cc
+++ b/extensions/renderer/module_system.cc
@@ -667,7 +667,8 @@ v8::Local<v8::Value> ModuleSystem::LoadModule(const std::string& module_name) {
return v8::Undefined(GetIsolate());
}
- exports->ForceSet(v8_key, function, v8::ReadOnly);
+ exports->DefineOwnProperty(v8_context, v8_key, function, v8::ReadOnly)
+ .FromJust();
v8::Local<v8::Object> natives(NewInstance());
CHECK(!natives.IsEmpty()); // this can fail if v8 has issues