Opened 3 years ago

Closed 3 years ago

#5895 closed defect (fixed)

Errorlog is off by one.

Reported by: bb Owned by: wraitii
Priority: Release Blocker Milestone: Alpha 24
Component: Core engine Keywords: regression
Cc: Patch: Phab:D3257

Description

Test assertions and syntax errors are logged at the wrong line when they fail. I.e., when something fails at line n, line n+1 is displayed.

Marking as releaseblocker since modmakers will run into this.

Change History (4)

comment:1 by wraitii, 3 years ago

See change in https://code.wildfiregames.com/rP24243#change-RZx8JXwxkUZB, didn't think much of it then.

Not sure yet why this happens, except that I'm pretty sure something gets wrapped in a function which adds a line.

comment:2 by Freagarach, 3 years ago

Keywords: regression added

comment:3 by Freagarach, 3 years ago

Patch: Phab:D3257

comment:4 by wraitii, 3 years ago

Owner: set to wraitii
Resolution: fixed
Status: newclosed

In 24455:

Fix off-by-one line number in JS error reporting.

Post SM60 upgrade, CompileFunction started actually adding a line in front of the source buffer, shifting the error reporting in the simulation and other callers of LoadScript.
The GUI isn't affected as it uses LoadGlobalScript, which uses Evaluate directly.

Refs #5859
Fixes #5895

Differential Revision: https://code.wildfiregames.com/D3257

Note: See TracTickets for help on using tickets.