Changeset 737

Show
Ignore:
Timestamp:
04/18/08 13:45:57 (8 months ago)
Author:
oyasu..@gmail.com
Message:

Folded global-object branch back to trunk.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/build.sh

    r719 r737  
    4545 
    4646echo "Patching chrome.manifest with jar ..." 
    47 sed -e \ 
    48         "/^content\|^skin\|^locale/s#\(.*\) chrome/\(.*\)#\1 jar:chrome/$GMNAME.jar!/\2#" \ 
    49         chrome.manifest > chrome.manifest.jar 
     47sed -e "/^content/s#\(.*\) chrome/\(.*\)#\1 jar:chrome/$GMNAME.jar!/\2#" \ 
     48    -e  "/^locale/s#\(.*\) chrome/\(.*\)#\1 jar:chrome/$GMNAME.jar!/\2#" \ 
     49    -e    "/^skin/s#\(.*\) chrome/\(.*\)#\1 jar:chrome/$GMNAME.jar!/\2#" \ 
     50    chrome.manifest > chrome.manifest.jar 
    5051mv chrome.manifest.jar chrome.manifest 
    5152 
  • trunk/src/components/greasemonkey.js

    r694 r737  
    303303      script.offsets = offsets; 
    304304 
    305       var scriptSrc = "(function(){\n" + 
     305      var scriptSrc = "\n" + // error line-number calculations depend on these 
    306306                         requires.join("\n") + 
    307307                         "\n" + 
    308308                         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); 
    314313    } 
    315314  }, 
     
    347346        Components.utils.evalInSandbox(code, sandbox); 
    348347      } 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 
    349351        // try to find the line of the actual error line 
    350352        var line = e.lineNumber; 
     
    379381      } 
    380382    } 
     383    return true; // did not need a (function() {...})() enclosure. 
    381384  }, 
    382385