Index: chrome/renderer/resources/require.js |
diff --git a/chrome/renderer/resources/require.js b/chrome/renderer/resources/require.js |
index 34f3543a432fe5bcd2348aaf24c2e3b270b0eff9..ad865a7bf69db5b0f438ae0111a594f56b25c38e 100644 |
--- a/chrome/renderer/resources/require.js |
+++ b/chrome/renderer/resources/require.js |
@@ -34,7 +34,7 @@ ModuleLoader.prototype.run = function(id) { |
return null; |
} |
var wrappedSource = wrap(source); |
Aaron Boodman
2012/03/01 07:24:26
Unless v8 does something fancy internally, it seem
Aaron Boodman
2012/03/01 07:30:32
I feel pretty strongly that the right answer here
koz (OOO until 15th September)
2012/03/02 01:13:58
As discussed, I've reimplemented with "new Functio
|
- var f = bootstrap.Run(wrappedSource); |
+ var f = bootstrap.Run(wrappedSource, id); |
var exports = {}; |
f(require, requireNative, exports); |
return exports; |
@@ -53,7 +53,11 @@ ModuleLoader.prototype.load = function(id) { |
var moduleLoader = new ModuleLoader(); |
function requireNative(nativeName) { |
- return bootstrap.GetNative(nativeName); |
+ var result = bootstrap.GetNative(nativeName); |
+ if (!result) { |
+ throw "No such native object: '" + nativeName + "'"; |
+ } |
+ return result; |
} |
function require(moduleId) { |