Opened 3 years ago

Closed 3 years ago

#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):



The bindings will currently declare a class as follows:

exports.InvalidFilter = createClass(exports.Filter, 0); = ...; = ...;

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).

Change History (3)

comment:1 Changed 3 years ago by trev

  • Review URL(s) modified (diff)
  • Status changed from new to reviewing

comment:2 Changed 3 years ago by abpbot

A commit referencing this issue has landed:
Issue 5185 - [emscripten More compact definition of class prototypes]

comment:3 Changed 3 years ago by trev

  • Resolution set to fixed
  • Status changed from reviewing to closed
Note: See TracTickets for help on using tickets.