-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Live binding incomplete #180
Comments
From the perspective of the importing module, live bindings are supposed to be immutable regardless of how they were declared in the exporting module, so (just to be clear) the As you know, the Reify-compiled version of the variable has to be mutable so that the setter function can assign it any value(s). There's nothing we can do about that, so I'm afraid Node can't help us once the code has been compiled. If you use the Babel plugin, the compiler should raise an exception in this case, because it considers Perhaps the Reify compiler should throw if it finds any assignments to imported symbols? Should that be the default behavior, and/or configurable? |
Ah nice!
If it can't be caught at runtime then a compile time check seems right. Since it's spec compliance stuff I think on-by-default is good (making it configurable is dealers choice). |
For reference the output test here should error. |
In adding a unit test for modifying a constant value I noticed a gap.
const.js
test.js
It should throw since
value
is aconst
, but currently reify doesn't track imported values, so doesn't wrap them in a setter call. It also definesvalue
with eithervar
orlet
but that prolly doesn't matter as much because if it were wrapped in a setter call an error would get thrown in theconst
module.The text was updated successfully, but these errors were encountered: