Comments (3)
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.
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
from as3shebang.
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
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from as3shebang.