facebookarchive/prepack

Implement Classes In The Interpreter

Open

#630 geöffnet am 10. Mai 2017

Auf GitHub ansehen
 (16 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)JavaScript (520 Forks)batch import
ES6help wantedinterpreter

Repository-Metriken

Stars
 (14.268 Stars)
PR-Merge-Metriken
 (Keine gemergten PRs in 30 T)

Beschreibung

This would be a good start to being able to fully serialize classes. The serialization part is difficult because we have to serialize some features like methods with super calls using the class syntax.

However this issue is only about implementing the interpreter.

A good starting point is here:

https://github.com/facebook/prepack/blob/master/src/evaluators/ClassDeclaration.js

Then copying the spec piece by piece.

https://www.ecma-international.org/ecma-262/6.0/#sec-runtime-semantics-classdefinitionevaluation

The syntax is already in the Babel AST. Most of the Value model such as HomeObject and new.target is already in place.

Any previously unimplemented methods of the spec will need to be implemented. Such as MakeClassConstructor.

Running yarn test-test262 will run the full test suite which can be used to validate the final result.

yarn repl is good for experiments.

Contributor Guide