-
Notifications
You must be signed in to change notification settings - Fork 87
Exo classes need to handle non-enumerable raw methods correctly. #1817
Description
Currently, the exo class creation functions fail to handle non-enumerable raw methods correctly.
At
endo/packages/exo/src/exo-tools.js
Line 291 in 877be98
| const { constructor: _, ...methods } = behaviorMethods; |
the code uses ... destructuring to take apart a collection of raw methods. But ... destructuring only gathers enumerable own methods.
At
endo/packages/exo/src/exo-tools.js
Line 268 in 877be98
| ...behaviorMethods, |
the code uses ... to add the raw methods into a larger collection of methods. But ... only extracts enumerable own methods.
So far, all raw methods arguments to the exo makers formed the collection of raw methods using an object literal, so all the methods were enumerable-own anyway. However, this code is intended to support use of a JavaScript class' .prototype as a collection of raw methods. These two flaws prevent that.