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
First off, thank you so much for all your great WebGL blog posts and projects, they're absolutely top-notch work all around.
Tonight I was toying around with bringing js-struct into your webgl-quake3 project but noticed Chrome Canary wasn't playing well with Struct.create. Basically, as you're well aware Struct.create will end up creating read functions for each structure and its properties that may look something like:
And, while in the middle of generating this function it'll call Object.defineProperty to define the ident property on Struct.struct_id_0 (here).
This seems to work fine in the current Chrome Stable, but in Chrome Canary the attempt to set ident on the new object will fail if it was defined on the prototype through Object.defineProperty (regardless of the writeable and configurable flags).
To perhaps illustrate this better, the following will print new value on Chrome Stable but old value on Chrome Canary:
At the end of the day, after reading about I'm not sure what the correct behavior here should be, but it doesn't seem the Object.defineProperty is necessary in the first place.
Any thoughts?
The text was updated successfully, but these errors were encountered:
As a follow up, there still appears to be one issue.
When you pass the object of extra properties to createStruct (e.g. dtexdata_t in webgl-source) you're not explicitly passing enumerable, writable and configurable properties but using them as such later on (which works fine in Chrome Stable, but not in Canary).
Perhaps those flags should be defaulted to true in createStruct?
Heya,
First off, thank you so much for all your great WebGL blog posts and projects, they're absolutely top-notch work all around.
Tonight I was toying around with bringing js-struct into your webgl-quake3 project but noticed Chrome Canary wasn't playing well with Struct.create. Basically, as you're well aware Struct.create will end up creating read functions for each structure and its properties that may look something like:
And, while in the middle of generating this function it'll call Object.defineProperty to define the
ident
property on Struct.struct_id_0 (here).This seems to work fine in the current Chrome Stable, but in Chrome Canary the attempt to set
ident
on the new object will fail if it was defined on the prototype through Object.defineProperty (regardless of the writeable and configurable flags).To perhaps illustrate this better, the following will print
new value
on Chrome Stable butold value
on Chrome Canary:At the end of the day, after reading about I'm not sure what the correct behavior here should be, but it doesn't seem the Object.defineProperty is necessary in the first place.
Any thoughts?
The text was updated successfully, but these errors were encountered: