Opened on 04/25/2017 at 02:08:49 PM
Closed on 04/27/2017 at 12:14:31 PM
#5185 closed change (fixed)
[emscripten] More compact definition of class prototypes
Reported by: | trev | Assignee: | trev |
---|---|---|---|
Priority: | P4 | Milestone: | |
Module: | Core | Keywords: | |
Cc: | Blocked By: | ||
Blocking: | #4122 | Platform: | Unknown / Cross platform |
Ready: | yes | Confidential: | no |
Tester: | Unknown | Verified working: | no |
Review URL(s): |
Description
Background
The bindings will currently declare a class as follows:
exports.InvalidFilter = createClass(exports.Filter, 0); exports.InvalidFilter.prototype.foo = ...; exports.InvalidFilter.prototype.bar = ...;
This is unnecessarily verbose.
What to change
Pass in all properties to be declared on the prototype to the createClass function:
exports.InvalidFilter = createClass(exports.Filter, 0, { foo: ..., bar: ..., });
The createClass function can then call Object.getOwnPropertyDescriptors() in order to copy these properties to the class prototype (this will work for getters and setters as well).
Attachments (0)
Change History (3)
Note: See
TracTickets for help on using
tickets.
A commit referencing this issue has landed:
Issue 5185 - [emscripten More compact definition of class prototypes]