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

Unified Diff: chrome/renderer/extensions/module_system.cc

Issue 17451011: Make the externally connectable browser test clobber all of the builtins, (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/renderer/extensions/safe_builtins.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/extensions/module_system.cc
diff --git a/chrome/renderer/extensions/module_system.cc b/chrome/renderer/extensions/module_system.cc
index 29575b2ec1ff20de6ad9245e001477ce528c4937..822c15e54853cdbf2a0034dfb6921a2779dfa969 100644
--- a/chrome/renderer/extensions/module_system.cc
+++ b/chrome/renderer/extensions/module_system.cc
@@ -189,6 +189,8 @@ v8::Handle<v8::Value> ModuleSystem::RequireForJsInner(
exports = v8::Object::New();
v8::Handle<v8::Object> natives(NewInstance());
+ CHECK(!natives.IsEmpty()); // this can happen if v8 has issues
+
// These must match the argument order in WrapSource.
v8::Handle<v8::Value> args[] = {
// CommonJS.
@@ -200,6 +202,8 @@ v8::Handle<v8::Value> ModuleSystem::RequireForJsInner(
context_->safe_builtins()->GetFunction(),
context_->safe_builtins()->GetJSON(),
context_->safe_builtins()->GetObjekt(),
+ context_->safe_builtins()->GetRegExp(),
+ context_->safe_builtins()->GetString(),
};
{
v8::TryCatch try_catch;
@@ -483,7 +487,7 @@ v8::Handle<v8::String> ModuleSystem::WrapSource(v8::Handle<v8::String> source) {
// Keep in order with the arguments in RequireForJsInner.
v8::Handle<v8::String> left = v8::String::New(
"(function(require, requireNative, exports,"
- "$Array, $Function, $JSON, $Object) {"
+ "$Array, $Function, $JSON, $Object, $RegExp, $String) {"
"'use strict';");
v8::Handle<v8::String> right = v8::String::New("\n})");
return handle_scope.Close(
« no previous file with comments | « no previous file | chrome/renderer/extensions/safe_builtins.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698