Skip to content
This repository was archived by the owner on Sep 13, 2020. It is now read-only.

Update CoffeeScriptRhinoCompiler.java #33

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/coffeescript/nb/CoffeeScriptRhinoCompiler.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,12 @@ public CompilerResult compile(String code, boolean bare) {
String message = (String) ScriptableObject.getProperty(error, "message");
IdScriptableObject location = (IdScriptableObject) ScriptableObject.getProperty(error, "location");
Double line = (Double) ScriptableObject.getProperty(location, "first_line");
Double column = (Double) ScriptableObject.getProperty(location, "first_column");
Double column;
if(col instanceof Integer) {
column = ((Integer)col).doubleValue();
} else {
column = (Double)col;
}
return new CompilerResult(new Error(line == null ? -1 : line.intValue()+1, column == null ? 0 : column.intValue()+1, message, message));
}
return new CompilerResult(new Error(-1, "", e.getMessage()));
Expand Down