File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
Core/src/main/java/prompto/declaration Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -1148,9 +1148,10 @@ private void transpileConstructor(Transpiler transpiler) {
11481148 transpiler .append ("this.$mutable = mutable;" ).newLine ();
11491149 transpiler .append ("return this;" ).dedent ().append ("}" ).newLine ();
11501150 List <Identifier > parents = (derivedFrom !=null && derivedFrom .size ()>0 ) ? derivedFrom : Collections .singletonList (new Identifier ("$Root" ));
1151+ transpiler .append (getName ()).append (".prototype = Object.create(" ).append (parents .get (0 ).toString ()).append (".prototype);" ).newLine ();
11511152 parents = parents .subList (0 , parents .size ());
1152- Collections .reverse (parents );
1153- transpiler .append (getName ()).append (".prototype = Object.assign({} " );
1153+ Collections .reverse (parents ); // fulfill MRO
1154+ transpiler .append (getName ()).append (".prototype = Object.assign(" ). append ( getName ()). append ( ".prototype " );
11541155 parents .forEach (p -> transpiler .append (", " ).append (p .toString ()).append (".prototype" ));
11551156 transpiler .append (");" ).newLine ();
11561157 transpiler .append (getName ()).append (".prototype.constructor = " ).append (getName ()).append (";" ).newLine ();
You can’t perform that action at this time.
0 commit comments