Skip to content
Snippets Groups Projects
Commit 6305d447 authored by rswindell's avatar rswindell
Browse files

Added todo comment about require() behavior which is unexpected when the

passesd filename is not found - function reports the symbol was not
defined rather than file not found or something similar.
parent 0d69795a
Branches
Tags
No related merge requests found
...@@ -723,6 +723,7 @@ js_require(JSContext *cx, uintN argc, jsval *arglist) ...@@ -723,6 +723,7 @@ js_require(JSContext *cx, uintN argc, jsval *arglist)
ret = js_load(cx, argc-1, arglist); ret = js_load(cx, argc-1, arglist);
// TODO: this error is happening if the file doesn't exist!
if (!JS_HasProperty(cx, exec_obj, property, &found) || !found) { if (!JS_HasProperty(cx, exec_obj, property, &found) || !found) {
JSVALUE_TO_MSTRING(cx, argv[fnarg], filename, NULL); JSVALUE_TO_MSTRING(cx, argv[fnarg], filename, NULL);
JS_ReportError(cx,"symbol '%s' not defined by script '%s'", property, filename); JS_ReportError(cx,"symbol '%s' not defined by script '%s'", property, filename);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment