facebookarchive/prepack

Implement Classes In The Interpreter

Open

#630 创建于 2017年5月10日

在 GitHub 查看
 (16 评论) (0 反应) (0 负责人)JavaScript (520 fork)batch import
ES6help wantedinterpreter

仓库指标

Star
 (14,268 star)
PR 合并指标
 (30 天内没有已合并 PR)

描述

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.

贡献者指南