public class Es6ToEs3ClassSideInheritance extends NodeTraversal.AbstractPostOrderCallback implements CompilerPass
Es6ToEs3Converter
will convert
class Foo { static f() {} } class Bar extends Foo {}to
function Foo() {} foo.f = function() {}; function Bar() {} $jscomp$copy$properties(Foo, Bar);and then this class will convert that to
function Foo() {} Foo.f = function() {}; function Bar() {} Bar.f = Foo.f;
Constructor and Description |
---|
Es6ToEs3ClassSideInheritance(AbstractCompiler compiler) |
Modifier and Type | Method and Description |
---|---|
void |
process(Node externs,
Node root)
Process the JS with root node root.
|
void |
visit(NodeTraversal nodeTraversal,
Node n,
Node parent)
Visits a node in postorder (after its children have been visited).
|
shouldTraverse
public Es6ToEs3ClassSideInheritance(AbstractCompiler compiler)
public void process(Node externs, Node root)
CompilerPass
process
in interface CompilerPass
externs
- Top of external JS treeroot
- Top of JS treepublic void visit(NodeTraversal nodeTraversal, Node n, Node parent)
NodeTraversal.Callback
Visits a node in postorder (after its children have been visited).
A node is visited only if all its parents should be traversed
(NodeTraversal.Callback.shouldTraverse(NodeTraversal, Node, Node)
).
Implementations can have side effects (e.g. modifying the parse tree).
visit
in interface NodeTraversal.Callback
Copyright © 2009-2014 Google. All Rights Reserved.