You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As discussed in #945, the current implementation of typeof expr needs to first evaluate the operand to check if it's an unresolved reference (so that it can return "undefined") and then call GetValue. This is not correct.
jint> const fn = () => { print('test'); }
undefined
jint> typeof fn();
test
test
"undefined"
jint>
The simple fix I attempted in #945 was calling Evaluate and then using _engine.GetValue to convert to a value, but it's not correct because different expressions have different GetValue implementation and it generated tons of problems.
Unfortunately I'm not proficient enough with jint internals to handle this issue, so this is only a bug report and not a PR.
The text was updated successfully, but these errors were encountered:
As discussed in #945, the current implementation of
typeof expr
needs to first evaluate the operand to check if it's an unresolved reference (so that it can return"undefined"
) and then callGetValue
. This is not correct.Correct behaviour in node:
With jint:
The simple fix I attempted in #945 was calling
Evaluate
and then using_engine.GetValue
to convert to a value, but it's not correct because different expressions have differentGetValue
implementation and it generated tons of problems.Unfortunately I'm not proficient enough with jint internals to handle this issue, so this is only a bug report and not a PR.
The text was updated successfully, but these errors were encountered: