@aurelia/jit
Advanced tools
Comparing version 0.3.0-dev.20181124 to 0.3.0-dev.20181126
{ | ||
"name": "@aurelia/jit", | ||
"version": "0.3.0-dev.20181124", | ||
"version": "0.3.0-dev.20181126", | ||
"main": "dist/index.umd.js", | ||
@@ -46,4 +46,4 @@ "module": "dist/index.es6.js", | ||
"dependencies": { | ||
"@aurelia/kernel": "^0.3.0-dev.20181124", | ||
"@aurelia/runtime": "^0.3.0-dev.20181124" | ||
"@aurelia/kernel": "^0.3.0-dev.20181126", | ||
"@aurelia/runtime": "^0.3.0-dev.20181126" | ||
}, | ||
@@ -81,6 +81,7 @@ "devDependencies": { | ||
"tslint-microsoft-contrib": "^5.2.1", | ||
"tslint-sonarts": "^1.8.0", | ||
"typescript": "^3.1.6", | ||
"webpack": "^4.25.1" | ||
}, | ||
"gitHead": "05d23715b6ca15e65f946b69637d16ed207e5020" | ||
"gitHead": "a188d7333d26216f4935bb8395eeb698451c2e9d" | ||
} |
@@ -94,2 +94,10 @@ // tslint:disable:no-non-null-assertion | ||
/*@internal*/ | ||
// JUSTIFICATION: This is performance-critical code which follows a subset of the well-known ES spec. | ||
// Knowing the spec, or parsers in general, will help with understanding this code and it is therefore not the | ||
// single source of information for being able to figure it out. | ||
// It generally does not need to change unless the spec changes or spec violations are found, or optimization | ||
// opportunities are found (which would likely not fix these warnings in any case). | ||
// It's therefore not considered to have any tangible impact on the maintainability of the code base. | ||
// For reference, most of the parsing logic is based on: https://tc39.github.io/ecma262/#sec-ecmascript-language-expressions | ||
// tslint:disable-next-line:no-big-function cognitive-complexity | ||
export function parse<TPrec extends Precedence, TType extends BindingType>(state: ParserState, access: Access, minPrecedence: TPrec, bindingType: TType): | ||
@@ -187,3 +195,2 @@ TPrec extends Precedence.Unary ? IsUnary : | ||
} | ||
continue; | ||
} else if (state.currentToken & Token.AccessScopeTerminal) { | ||
@@ -678,2 +685,3 @@ const ancestor = access & Access.Ancestor; | ||
const cooked = [state.tokenValue as string]; | ||
// TODO: properly implement raw parts / decide whether we want this | ||
//const raw = [state.tokenRaw]; | ||
@@ -680,0 +688,0 @@ consume(state, Token.TemplateContinuation); |
@@ -279,2 +279,3 @@ import { Immutable, IServiceLocator, PLATFORM } from '@aurelia/kernel'; | ||
// TODO: Reduce complexity (currently at 60) | ||
constructor( | ||
@@ -281,0 +282,0 @@ semanticModel: SemanticModel, |
@@ -119,7 +119,6 @@ import { inject, PLATFORM } from '@aurelia/kernel'; | ||
if (name !== 'id' && name !== 'part' && name !== 'replace-part') { | ||
// tslint:disable-next-line:no-small-switch | ||
switch (name) { | ||
// TODO: handle simple surrogate style attribute | ||
case 'style': | ||
attrInst = new SetAttributeInstruction($attr.rawValue, name); | ||
break; | ||
default: | ||
@@ -314,14 +313,11 @@ attrInst = new SetAttributeInstruction($attr.rawValue, name); | ||
} | ||
// plain attribute on a custom element | ||
if ($attr.onCustomElement) { | ||
// bindable attribute | ||
if ($attr.isElementBindable) { | ||
const expression = parser.parse($attr.rawValue, BindingType.Interpolation); | ||
if (expression === null) { | ||
// no interpolation -> make it a setProperty on the component | ||
return new SetPropertyInstruction($attr.rawValue, $attr.to); | ||
} | ||
// interpolation -> behave like toView (e.g. foo="${someProp}") | ||
return new InterpolationInstruction(expression, $attr.to); | ||
// plain bindable attribute on a custom element | ||
if ($attr.onCustomElement && $attr.isElementBindable) { | ||
const expression = parser.parse($attr.rawValue, BindingType.Interpolation); | ||
if (expression === null) { | ||
// no interpolation -> make it a setProperty on the component | ||
return new SetPropertyInstruction($attr.rawValue, $attr.to); | ||
} | ||
// interpolation -> behave like toView (e.g. foo="${someProp}") | ||
return new InterpolationInstruction(expression, $attr.to); | ||
} | ||
@@ -328,0 +324,0 @@ { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
742258
8216
33