Skip to content

Commit

Permalink
Fix hashbang checks not using all line terminator chars
Browse files Browse the repository at this point in the history
Should make 2 more test262 hashbang tests pass.
  • Loading branch information
CanadaHonk authored Jun 12, 2023
1 parent 553dafe commit f24883f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion toolsrc/org/mozilla/javascript/tools/shell/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import org.mozilla.javascript.Script;
import org.mozilla.javascript.Scriptable;
import org.mozilla.javascript.ScriptableObject;
import org.mozilla.javascript.ScriptRuntime;
import org.mozilla.javascript.SecurityController;
import org.mozilla.javascript.commonjs.module.ModuleScope;
import org.mozilla.javascript.commonjs.module.Require;
Expand Down Expand Up @@ -566,7 +567,7 @@ static void processFileSecure(Context cx, Scriptable scope, String path, Object
if (strSrc.length() > 0 && strSrc.charAt(0) == '#') {
for (int i = 1; i != strSrc.length(); ++i) {
int c = strSrc.charAt(i);
if (c == '\n' || c == '\r') {
if (ScriptRuntime.isJSLineTerminator(c)) {
strSrc = strSrc.substring(i);
break;
}
Expand Down

0 comments on commit f24883f

Please sign in to comment.