-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
The following snippet
let hudObject = {
// imagine a lot of content here :)
xx1: 1,
xx2: 2,
xx3: 3,
xx4: 4,
xx5: 5,
xx6: 6,
xx7: 7,
xx8: 8,
xx9: 9,
xx10: 10,
xx11: 11,
xx12: 12,
xx13: 13,
xx14: 14,
xx15: 15,
xx16: 16
}
return hudObject;
fails to parse with error:
[Exception(EPOCASyntaxError["poca/hud.poca"):2,15]: Precedence level overflow
A better error message would be helpful, pointing that return right after } is not correct.
Right now the
- line number (2) points to the beginning of statement (not to the line where
}orreturnare) - and the message is not obvious :) -- what is wrong with "precedence level" here.
I tested what JS reports for this, but it seems that missing ; is actually allowed. That is,
function foo()
{
let hudObject = {
xx1: 1,
xx2: 2,
xx3: 3,
xx4: 4,
xx5: 5,
xx6: 6,
xx7: 7,
xx8: 8,
xx9: 9,
xx10: 10,
xx11: 11,
xx12: 12,
xx13: 13,
xx14: 14,
xx15: 15,
xx16: 16
}
return hudObject;
}
works OK in a browser (Firefox) console and https://runjs.app/play .
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels