Code Monkey home page Code Monkey logo

Comments (3)

zwetan avatar zwetan commented on July 18, 2024

example:

#!/usr/bin/env as3shebang -el -ec

import shell.*;
import C.macros.*;

trace( "local script" );

trace( "args = " + Program.argv );
trace( "file = " + __FILE__ );
trace( "line = " + __LINE__ );
trace( UNKNOWN );
//throw new Error( "hello world" );

trace( "EOF" );

trace( UNKNOWN ); is on line 11

but the error stack trace shows

ReferenceError: Error #1065: Variable UNKNOWN is not defined.
	at global$init()[:20]
	at shell::Runtime$/eval()
	at corsaair.tools.as3shebang::App/main()
	at global$init()

that's because the wrapper scripts add 9 lines at the top

from as3shebang.

zwetan avatar zwetan commented on July 18, 2024

ok problem fixed by saving the wrapper scripts line numbers
in the global var _global.as3sh_err_line_diff

and then scanning the error stack trace line number
subtracting this number
error_line_number

from as3shebang.

zwetan avatar zwetan commented on July 18, 2024

well ... the problem occurs again when the stack trace contains multiple line numbers

with this script

#!/usr/bin/env as3shebang -el -ec

import shell.*;
import C.macros.*;

function something()
{
    return UNKNOWN;
}

trace( "local script" );

trace( "args = " + Program.argv );
trace( "file = " + __FILE__ );
trace( "line = " + __LINE__ );
trace( something() );
//throw new Error( "hello world" );

trace( "EOF" );

return UNKNOWN; is on line 8
but the function call generating the error
trace( something() ); is on line 16

see
skewed_error_line_number

the first error number in the stack trace is correct

at Function/anonymous()[:8] for return UNKNOWN;

but the second line is incorrect
at global$init()[:25] for trace( something() );

should be at global$init()[:16]

from as3shebang.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.