Commit e1b5978
authored
Fix unnoticed exception in JS_DetectModule (#889)
JS_DetectModule calls JS_AddIntrinsicRegExp but that indirectly uses
`ctx->global_obj` when it tries to define `globalThis.RegExp`.
There is no `ctx->global_obj` however because JS_NewContextRaw doesn't
create one. It raised an "not an object" TypeError that went unnoticed
because there is no error checking in JS_NewGlobalCConstructor2.
Using JS_AddIntrinsicRegExpCompiler is better all around because we
only need to parse regexp literals, nothing more.
JS_NewGlobalCConstructor2 should probably be changed to do proper error
checking, and __JS_EvalInternal to return JS_EXCEPTION when an exception
is pending on entry, but I'll save that for another commit.1 parent 766d967 commit e1b5978
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56285 | 56285 | | |
56286 | 56286 | | |
56287 | 56287 | | |
56288 | | - | |
| 56288 | + | |
56289 | 56289 | | |
56290 | 56290 | | |
56291 | 56291 | | |
| |||
0 commit comments