| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
There was a problem hiding this comment.
This doesn't really seem like something we need to care in our tests (in no credible scenario will anyone tries to check what's the value of Object.isSealed(kEnumerableProperty) in core, and if there was a way to make sure the object always behaves as we want it to that doesn't involve freezing it, that'd be fine too), the consequences are what's really important to test imo:
| assert.strictEqual( | |
| Object.isExtensible(kEnumerableProperty), | |
| false | |
| ); | |
| assert.strictEqual( | |
| Object.isSealed(kEnumerableProperty), | |
| true | |
| ); | |
| assert.strictEqual( | |
| Object.isFrozen(kEnumerableProperty), | |
| true | |
| ); | |
| assert.throws( | |
| () => { kEnumerableProperty.configurable = false; }, | |
| TypeError | |
| ); | |
| assert.throws( | |
| () => Object.assign(kEnumerableProperty, { configurable: false }), | |
| TypeError | |
| ); | |
| assert.throws( | |
| () => Object.assign(kEnumerableProperty, { enumerable: false }), | |
| TypeError | |
| ); |
Sorry, something went wrong.
There was a problem hiding this comment.
Conceptually agreed. :)
My concern here is that by assuming alternatives to freezing and possibility of something dangerous (e.g. if there will be unavoidable exposing reference to kEnumerableProperty for userland) we must keep in mind every single way to break it.
If that approach will become common in core, we'll have to create an exhaustive isImmutable() helper function instead.
Sorry, something went wrong.
Sorry, something went wrong.
|
Looks like CI got borked recently |
Sorry, something went wrong.
Sorry, something went wrong.
Sorry, something went wrong.
PR-URL: nodejs#43390 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Beth Griggs <bgriggs@redhat.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
PR-URL: #43390 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Beth Griggs <bgriggs@redhat.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
PR-URL: #43390 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Beth Griggs <bgriggs@redhat.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
PR-URL: #43390 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Beth Griggs <bgriggs@redhat.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
PR-URL: nodejs/node#43390 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Beth Griggs <bgriggs@redhat.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
| Back | FazBrowse Home | New Git URL |
Refs: #43159 (comment)