Changeset 732
- Timestamp:
- 04/15/08 08:33:30 (8 months ago)
- Files:
-
- branches/global-object/components/greasemonkey.js (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/global-object/components/greasemonkey.js
r694 r732 303 303 script.offsets = offsets; 304 304 305 var scriptSrc = " (function(){\n" +305 var scriptSrc = "\n" + // error line-number calculations depend on these 306 306 requires.join("\n") + 307 307 "\n" + 308 308 contents + 309 "\n})()"; 310 this.evalInSandbox(scriptSrc, 311 url, 312 sandbox, 313 script); 309 "\n"; 310 if (!this.evalInSandbox(scriptSrc, url, sandbox, script)) 311 this.evalInSandbox("(function(){"+ scriptSrc +"})()", 312 url, sandbox, script); 314 313 } 315 314 }, … … 347 346 Components.utils.evalInSandbox(code, sandbox); 348 347 } catch (e) { 348 if ("return not in function" == e.message) // pre-0.8 GM compat: 349 return false; // this script depends on the function enclosure 350 349 351 // try to find the line of the actual error line 350 352 var line = e.lineNumber; … … 379 381 } 380 382 } 383 return true; // did not need a (function() {...})() enclosure. 381 384 }, 382 385
