diff --git a/src/duk_builtin_error.c b/src/duk_builtin_error.c index bb43878a..296001c4 100644 --- a/src/duk_builtin_error.c +++ b/src/duk_builtin_error.c @@ -153,7 +153,7 @@ int duk_builtin_error_prototype_stack(duk_context *ctx) { pc = (int) fmod(d, DUK_DOUBLE_2TO32); flags = (int) floor(d / DUK_DOUBLE_2TO32); duk_get_prop_stridx(ctx, -2, DUK_STRIDX_NAME); - duk_get_prop_stridx(ctx, -3, DUK_STRIDX_INT_FILENAME); + duk_get_prop_stridx(ctx, -3, DUK_STRIDX_FILE_NAME); duk_get_prop_stridx(ctx, -4, DUK_STRIDX_INT_PC2LINE); if (duk_is_buffer(ctx, -1)) { diff --git a/src/duk_js_compiler.c b/src/duk_js_compiler.c index a37fc14e..7edc9c61 100644 --- a/src/duk_js_compiler.c +++ b/src/duk_js_compiler.c @@ -837,14 +837,14 @@ static void convert_to_function_template(duk_compiler_ctx *comp_ctx) { */ } - /* _filename */ + /* fileName */ if (comp_ctx->h_filename) { /* * Source filename (or equivalent), for identifying thrown errors. */ duk_push_hstring(ctx, comp_ctx->h_filename); - duk_def_prop_stridx(ctx, -2, DUK_STRIDX_INT_FILENAME, DUK_PROPDESC_FLAGS_NONE); + duk_def_prop_stridx(ctx, -2, DUK_STRIDX_FILE_NAME, DUK_PROPDESC_FLAGS_NONE); } /* diff --git a/src/duk_js_var.c b/src/duk_js_var.c index 598ce504..e94f244c 100644 --- a/src/duk_js_var.c +++ b/src/duk_js_var.c @@ -113,10 +113,10 @@ void duk_js_push_closure(duk_hthread *thr, duk_hcompiledfunction *fun_clos; duk_u16 proplist[] = { DUK_STRIDX_INT_VARMAP, DUK_STRIDX_INT_FORMALS, - DUK_STRIDX_INT_SOURCE, DUK_STRIDX_NAME, DUK_STRIDX_INT_PC2LINE, - DUK_STRIDX_INT_FILENAME }; /* order: most frequent to least frequent */ + DUK_STRIDX_FILE_NAME, + DUK_STRIDX_INT_SOURCE }; /* order: most frequent to least frequent */ int i; duk_u32 len_value; diff --git a/src/genstrings.py b/src/genstrings.py index 7eb848dd..ede29e3b 100644 --- a/src/genstrings.py +++ b/src/genstrings.py @@ -483,7 +483,8 @@ duk_string_list = [ mkstr("tracedata", custom=True), # non-standard function instance properties - mkstr("name", custom=True), # function declaration/expression name (or empty) + mkstr("name", custom=True), # function declaration/expression name (or empty) + mkstr("fileName", custom=True), # filename associated with function (shown in tracebacks) # typeof - these produce unfortunate naming conflicts like "Object" vs "object" mkstr("buffer", custom=True), @@ -506,7 +507,6 @@ duk_string_list = [ mkstr("varenv", internal=True, custom=True), mkstr("source", internal=True, custom=True), mkstr("pc2line", internal=True, custom=True), - mkstr("filename", internal=True, custom=True), # internal properties for thread objects