refactor(compiler): don’t use AppElements for creating component views

This commit is contained in:
Tobias Bosch
2016-11-01 09:35:03 -07:00
committed by vikerman
parent 13533d2a30
commit d1035da85c
11 changed files with 79 additions and 66 deletions

View File

@ -24,7 +24,7 @@ export function main() {
const definedView = createCompileView({className: 'parentView'});
const callingView = createCompileView({className: 'childView', parent: definedView});
expect(getPropertyInView(expr, callingView, definedView))
.toEqual(o.THIS_EXPR.prop('parent').prop('someProp'));
.toEqual(o.THIS_EXPR.prop('parentView').prop('someProp'));
});
it('should access a known property in a parent view with cast', () => {
@ -32,7 +32,7 @@ export function main() {
const definedView = createCompileView({className: 'parentView', fields: ['someProp']});
const callingView = createCompileView({className: 'childView', parent: definedView});
expect(getPropertyInView(expr, callingView, definedView))
.toEqual(o.THIS_EXPR.prop('parent').cast(definedView.classType).prop('someProp'));
.toEqual(o.THIS_EXPR.prop('parentView').cast(definedView.classType).prop('someProp'));
});
it('should access a known property in a parent view with cast also for property chain expressions',
@ -41,7 +41,7 @@ export function main() {
const definedView = createCompileView({className: 'parentView', fields: ['someProp']});
const callingView = createCompileView({className: 'childView', parent: definedView});
expect(getPropertyInView(expr, callingView, definedView))
.toEqual(o.THIS_EXPR.prop('parent')
.toEqual(o.THIS_EXPR.prop('parentView')
.cast(definedView.classType)
.prop('someProp')
.prop('context'));