greasemonkey/greasemonkey — Issue #1491: @required scripts without final semicolon cause problems
Author: FinnE
Created: 2012-01-03 11:00:56+00:00
State: open

Greasemonkey 0.9.13 on Firefox 8.0.1.

#### Speculation:
It appears that @required scripts that do not end in a semicolon can cause problems in the user script.

#### Steps to reproduce:
1. Create a new user script which @includes *.
2. @require the minified jQuery and jQuery-UI 1.8.17 (in that order) from Google APIs (http://code.google.com/apis/libraries/devguide.html#jquery).
3. Put an alert call inside an anonymous wrapper function in the user script, e.g.: ```(function(){alert("Hello")})();```
4. Install and run the script.

#### Expected result:
- Alert is called, producing a dialogue box.

#### Actual result:
- Nothing happens.

#### Workaound:
- Add a semicolon to the start of the user script.

### Conclusion:
While not hard to work around, the problem is hard to identify, as it produces no errors or obvious side effects (besides the user script doing nothing).