Summarize the current status, the bug needs to do the following things: 1. Looks up the corresponding actor. 2. Constructed it if it hasn't been constructed yet. 2a. Load module URI. 2b. Construct the actor. 3. Return the actor. I'm working on 2b. In 2b, I was trying two different ways to construct an actor. The first way, I want to get constructor from module's export, then call the constructor to create an object instance. However, I can't get constructor from module's export. I guess it's because the module's export only has the class declaration, not the instance of the class. The second way, I want to get class from module's export, then create an object instance by the class. However, I use JS_NewObject to create an object instance, the prototype is undefined. If I'm in the wrong direction, please let me know.
Bug 1513878 Comment 2 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
Summarize the current status, the bug needs to do the following things: 1. Looks up the corresponding actor. 2. Constructed it if it hasn't been constructed yet. 2a. Load module URI. 2b. Construct the actor. 3. Return the actor. I'm working on 2b. In 2b, I was trying two different ways to construct an actor. The first way, I want to get constructor from module's export, then call the constructor to create an object instance. However, I can't get constructor from module's export. I guess it's because the module's export only has the class declaration, not the instance of the class, so there is no constructor's function object. The second way, I want to get class from module's export, then create an object instance by the class. However, I use JS_NewObject to create an object instance, the prototype is undefined. If I'm in the wrong direction, please let me know.