-
Notifications
You must be signed in to change notification settings - Fork 93
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
Object property defined with Object.defineProperty gets immediately evaluated #197
Comments
Can you craft a minimal repro in an rb file? Keep in mind load is a simple wrapper around eval. |
Yes, I saw the definition of the Please find example files attached. I saw that if I call the method |
I think I know what is happening here. The last element in a script is returned to the caller of I guess a fix here would be to have load use a special flavor of A simple workaround would be a custom eval function:
Happy to fix up |
Thank you for your answer :) |
Has this ever been implemented, @SamSaffron? Having |
Hello,
I hope this is the right place to ask...
I have a lot of components defined in different files and in my ruby code I'm loading them using the load function:
I moved outside of the component's
init
function the definition of a property:Before:
After:
And now I'm getting the exception
when I simply load the file in the context.
It looks to me that somehow after defining the property, the engine tries to access it and since the component is not initialized yet, I get the exception.
I don't know if this is a bug or it's the expected behavior, I'm running the same code in the browser and it's fine.
If I make the property not enumerable it doesn't happen, but I need the property to be enumerable, so the only workaround is to change the code to skip that check if I'm running the code server side:
But I wanted to know why it is happening, if I've found a bug or I'm doing something wrong.
Thank you for your support!
The text was updated successfully, but these errors were encountered: