feat(injector): initial implementaion of dynamic injector
This commit is contained in:
@ -73,7 +73,8 @@ export class ClassTransformer extends ParseTreeTransformer {
|
||||
// Collect all fields, defined in the constructor.
|
||||
elementTree.body.statements.forEach(function(statement) {
|
||||
var exp = statement.expression;
|
||||
if (exp.type === BINARY_EXPRESSION &&
|
||||
if (exp &&
|
||||
exp.type === BINARY_EXPRESSION &&
|
||||
exp.operator.type === EQUAL &&
|
||||
exp.left.type === MEMBER_EXPRESSION &&
|
||||
exp.left.operand.type === THIS_EXPRESSION) {
|
||||
@ -170,7 +171,8 @@ export class ClassTransformer extends ParseTreeTransformer {
|
||||
var superCall = null;
|
||||
|
||||
body.statements.forEach(function (statement) {
|
||||
if (statement.expression.type === CALL_EXPRESSION &&
|
||||
if (statement.expression &&
|
||||
statement.expression.type === CALL_EXPRESSION &&
|
||||
statement.expression.operand.type === SUPER_EXPRESSION) {
|
||||
superCall = statement.expression;
|
||||
} else {
|
||||
|
@ -11,7 +11,8 @@ import {
|
||||
OPEN_CURLY,
|
||||
OPEN_PAREN,
|
||||
SEMI_COLON,
|
||||
STAR
|
||||
STAR,
|
||||
STATIC
|
||||
} from 'traceur/src/syntax/TokenType';
|
||||
|
||||
import {ParseTreeWriter as JavaScriptParseTreeWriter, ObjectLiteralExpression} from 'traceur/src/outputgeneration/ParseTreeWriter';
|
||||
|
Reference in New Issue
Block a user