Comments (12)
This is definitely an improvement over the current solution which results in very confusing backtraces.
from duktape.
Looks definitely like something to fix, thanks for reporting it.
from duktape.
Technically it might be useful if the modSearch()
function could provide the filename if the file actually gets loaded from a file system (not always the case but quite common).
Unfortunately this isn't easily fixable for 1.x because but we can look into changing the contract (@creationix had also some issues with the current one, specifically re: giving a fully resolved ID to modSearch) in 2.0.
from duktape.
Ah, I see. The duk_bi_global_object_require()
already does the following which spot fixes the fileName for the module function itself, but that of course doesn't get "inherited" into functions defined within the module:
/* Finish the wrapped module source. */
duk_push_string(ctx, "})");
duk_concat(ctx, 3);
duk_eval(ctx);
/* Force 'fileName' property of the module function so that if the
* module creates a logger, the logger name defaults to the module
* name.
*/
duk_dup(ctx, 3);
duk_put_prop_stridx(ctx, -2, DUK_STRIDX_FILE_NAME);
The proposed change fixes the issue and also removes the unnecessary forcing of the fileName, which is nice. I'll merge a fix soon.
from duktape.
The merge should fix the issue, and the following testcase was added to check for the preferred behavior at this point:
from duktape.
@emil-e It'd be nice to hear if the merge (in master) fixed this issue for you. Quite probably so because the fix is practically the one you suggested originally, but still :)
from duktape.
I'll check it out :)
On Thursday, October 30, 2014, Sami Vaarala [email protected]
wrote:
@emil-e https://github.com/emil-e It'd be nice to hear if the merge (in
master) fixed this issue for you. Quite probably so because the fix is
practically the one you suggested originally, but still :)—
Reply to this email directly or view it on GitHub
#58 (comment).
from duktape.
This is now also fixed in 1.0.1 release.
from duktape.
Awesome thanks. I wanted this patch, but I'm trying to be good and stick to released versions.
from duktape.
FWIW, I use 1.0.1 in https://github.com/andoma/showtime/ and there it now prints backtraces as it should.
from duktape.
@emil-e I'll close this now because it seems to be fixed - if not, please reopen.
from duktape.
Sorry for the delay, I haven't had time to test it since I've been
traveling but I can't imagine this not working. Andoma tested it and it
worked for him so I'm perfectly fine with closing. Thanks for the great
response!
On Friday, November 7, 2014, Sami Vaarala [email protected] wrote:
—
Reply to this email directly or view it on GitHub
#58 (comment).
from duktape.
Related Issues (20)
- Q: Example of using JS callbacks HOT 11
- Makefile.cmdline builds a broken binary that instantly segfaults
- dukluv forward compat HOT 3
- New release? 🤔 HOT 2
- loading handlebars helpers HOT 1
- Is nested duk_pcall_* from the same thread supported? HOT 1
- Instructions for compiling CBOR?
- CBOR vs. JSON performance -- why is CBOR.encode so much slower than JSON.stringify? HOT 5
- An issue with breaking out of labeled blocks
- An issue with undefined and postfix operators
- stack-overflow in duktape/duk_js_call.c:1361 in duk__call_setup_act_attempt_tailcall
- stack-overflow in duktape/duk_api_stack.c:337 in duk_is_valid_posidx
- stack-overflow in duk__try_push_vsprintf in duktape/duk_api_stack.c:4800:8
- stack-overflow in duktape/duk_hobject_assert.c:215 in duk_hthread_assert_valid
- stack-overflow in duktape/duk_js_call.c:1570 in duk__call_setup_act_not_tailcall
- stack-overflow in duktape/duk_hobject_props.c:272 in duk__hobject_get_entry_object_stridx
- Security concern
- Help wanted with nested objects
- Iterating keys of proxy object HOT 1
- make file which also installs duktape fails HOT 1
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 duktape.