New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@aurelia/jit

Package Overview
Dependencies
Maintainers
1
Versions
554
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aurelia/jit - npm Package Compare versions

Comparing version 0.3.0-dev.20181115 to 0.3.0-dev.20181116

31

dist/binding-command.d.ts

@@ -0,1 +1,2 @@

import { IRegistry } from '@aurelia/kernel';
import { IExpressionParser, IResourceKind, IResourceType, TargetedInstruction } from '@aurelia/runtime';

@@ -16,4 +17,5 @@ import { IAttributeSymbol } from './semantic-model';

export declare class OneTimeBindingCommand implements IBindingCommand {
static inject: Function[];
static register: IRegistry['register'];
private parser;
static inject: Function[];
constructor(parser: IExpressionParser);

@@ -25,4 +27,5 @@ compile($symbol: IAttributeSymbol): TargetedInstruction;

export declare class ToViewBindingCommand implements IBindingCommand {
static inject: Function[];
static register: IRegistry['register'];
private parser;
static inject: Function[];
constructor(parser: IExpressionParser);

@@ -34,4 +37,5 @@ compile($symbol: IAttributeSymbol): TargetedInstruction;

export declare class FromViewBindingCommand implements IBindingCommand {
static inject: Function[];
static register: IRegistry['register'];
private parser;
static inject: Function[];
constructor(parser: IExpressionParser);

@@ -43,4 +47,5 @@ compile($symbol: IAttributeSymbol): TargetedInstruction;

export declare class TwoWayBindingCommand implements IBindingCommand {
static inject: Function[];
static register: IRegistry['register'];
private parser;
static inject: Function[];
constructor(parser: IExpressionParser);

@@ -52,4 +57,4 @@ compile($symbol: IAttributeSymbol): TargetedInstruction;

export declare class DefaultBindingCommand implements IBindingCommand {
private parser;
static inject: Function[];
static register: IRegistry['register'];
$1: typeof OneTimeBindingCommand.prototype.compile;

@@ -59,2 +64,3 @@ $2: typeof ToViewBindingCommand.prototype.compile;

$6: typeof TwoWayBindingCommand.prototype.compile;
private parser;
constructor(parser: IExpressionParser);

@@ -66,4 +72,5 @@ compile($symbol: IAttributeSymbol): TargetedInstruction;

export declare class TriggerBindingCommand implements IBindingCommand {
static inject: Function[];
static register: IRegistry['register'];
private parser;
static inject: Function[];
constructor(parser: IExpressionParser);

@@ -75,4 +82,5 @@ compile($symbol: IAttributeSymbol): TargetedInstruction;

export declare class DelegateBindingCommand implements IBindingCommand {
static inject: Function[];
static register: IRegistry['register'];
private parser;
static inject: Function[];
constructor(parser: IExpressionParser);

@@ -84,4 +92,5 @@ compile($symbol: IAttributeSymbol): TargetedInstruction;

export declare class CaptureBindingCommand implements IBindingCommand {
static inject: Function[];
static register: IRegistry['register'];
private parser;
static inject: Function[];
constructor(parser: IExpressionParser);

@@ -93,4 +102,5 @@ compile($symbol: IAttributeSymbol): TargetedInstruction;

export declare class CallBindingCommand implements IBindingCommand {
static inject: Function[];
static register: IRegistry['register'];
private parser;
static inject: Function[];
constructor(parser: IExpressionParser);

@@ -100,4 +110,5 @@ compile($symbol: IAttributeSymbol): TargetedInstruction;

export declare class ForBindingCommand implements IBindingCommand {
static inject: Function[];
static register: IRegistry['register'];
private parser;
static inject: Function[];
constructor(parser: IExpressionParser);

@@ -104,0 +115,0 @@ compile($symbol: IAttributeSymbol): TargetedInstruction;

@@ -7,5 +7,4 @@ export * from './attribute-parser';

export * from './expression-parser';
export * from './instructions';
export * from './semantic-model';
export * from './template-compiler';
//# sourceMappingURL=index.d.ts.map
import { Immutable, IServiceLocator } from '@aurelia/kernel';
import { BindingMode, IAttributeDefinition, IBindableDescription, IExpressionParser, IResourceDescriptions, ITemplateDefinition, TargetedInstruction } from '@aurelia/runtime';
import { BindingMode, HydrateTemplateController, IAttributeDefinition, IBindableDescription, IExpressionParser, IResourceDescriptions, ITemplateDefinition, TargetedInstruction } from '@aurelia/runtime';
import { AttrSyntax, IAttributeParser } from './attribute-parser';
import { IBindingCommand } from './binding-command';
import { ElementSyntax, IElementParser } from './element-parser';
import { HydrateTemplateController } from './instructions';
export declare class SemanticModel {
readonly isSemanticModel: true;
readonly root: ElementSymbol;
resources: IResourceDescriptions;

@@ -12,4 +13,2 @@ attrParser: IAttributeParser;

exprParser: IExpressionParser;
readonly isSemanticModel: true;
readonly root: ElementSymbol;
private readonly attrDefCache;

@@ -30,14 +29,15 @@ private readonly elDefCache;

export interface IAttributeSymbol {
readonly isMultiAttrBinding: boolean;
readonly $element: ElementSymbol;
readonly syntax: AttrSyntax;
readonly command: IBindingCommand | null;
readonly target: string;
readonly res: string | null;
readonly to: string;
readonly mode: BindingMode;
readonly bindable: IBindableDescription;
readonly rawName: string;
readonly rawValue: string;
readonly rawCommand: string;
readonly syntax: AttrSyntax;
readonly command: IBindingCommand | null;
readonly to: string;
readonly mode: BindingMode;
readonly bindable: IBindableDescription;
readonly hasBindingCommand: boolean;
readonly isMultiAttrBinding: boolean;
readonly isHandledByBindingCommand: boolean;

@@ -50,3 +50,2 @@ readonly isTemplateController: boolean;

readonly isElementBindable: boolean;
readonly $element: ElementSymbol;
}

@@ -56,14 +55,15 @@ export declare class MultiAttributeBindingSymbol implements IAttributeSymbol {

readonly $parent: AttributeSymbol;
readonly $element: ElementSymbol;
readonly syntax: AttrSyntax;
readonly command: IBindingCommand | null;
readonly isMultiAttrBinding: boolean;
readonly target: string;
readonly res: string;
readonly to: string;
readonly mode: BindingMode;
readonly bindable: Immutable<Required<IBindableDescription>> | null;
readonly rawName: string;
readonly rawValue: string;
readonly rawCommand: string | null;
readonly to: string;
readonly mode: BindingMode;
readonly bindable: Immutable<Required<IBindableDescription>> | null;
readonly hasBindingCommand: boolean;
readonly isMultiAttrBinding: boolean;
readonly isHandledByBindingCommand: boolean;

@@ -76,3 +76,2 @@ readonly isTemplateController: boolean;

readonly isElementBindable: boolean;
readonly $element: ElementSymbol;
constructor(semanticModel: SemanticModel, $parent: AttributeSymbol, syntax: AttrSyntax, command: IBindingCommand | null);

@@ -82,25 +81,25 @@ }

readonly semanticModel: SemanticModel;
readonly definition: IAttributeDefinition | null;
readonly $element: ElementSymbol;
readonly syntax: AttrSyntax;
readonly definition: IAttributeDefinition | null;
readonly command: IBindingCommand | null;
readonly isMultiAttrBinding: boolean;
readonly $multiAttrBindings: ReadonlyArray<MultiAttributeBindingSymbol>;
readonly target: string;
readonly res: string | null;
readonly to: string;
readonly mode: BindingMode;
readonly bindable: Immutable<Required<IBindableDescription>> | null;
readonly rawName: string;
readonly rawValue: string;
readonly rawCommand: string | null;
readonly to: string;
readonly mode: BindingMode;
readonly bindable: Immutable<Required<IBindableDescription>> | null;
readonly hasBindingCommand: boolean;
readonly isMultiAttrBinding: boolean;
readonly isHandledByBindingCommand: boolean;
readonly isTemplateController: boolean;
readonly isCustomAttribute: boolean;
readonly isAttributeBindable: boolean;
readonly isDefaultAttributeBindable: boolean;
readonly isCustomAttribute: boolean;
readonly onCustomElement: boolean;
readonly isElementBindable: boolean;
readonly onCustomElement: boolean;
readonly $multiAttrBindings: ReadonlyArray<MultiAttributeBindingSymbol>;
readonly isBindable: boolean;
readonly isTemplateController: boolean;
readonly hasBindingCommand: boolean;
readonly isHandledByBindingCommand: boolean;
private _isProcessed;

@@ -107,0 +106,0 @@ readonly isProcessed: boolean;

{
"name": "@aurelia/jit",
"version": "0.3.0-dev.20181115",
"version": "0.3.0-dev.20181116",
"main": "dist/index.umd.js",

@@ -46,4 +46,4 @@ "module": "dist/index.es6.js",

"dependencies": {
"@aurelia/kernel": "^0.3.0-dev.20181115",
"@aurelia/runtime": "^0.3.0-dev.20181115"
"@aurelia/kernel": "^0.3.0-dev.20181116",
"@aurelia/runtime": "^0.3.0-dev.20181116"
},

@@ -84,3 +84,3 @@ "devDependencies": {

},
"gitHead": "2539874d78f1fc99f4c0598472113c8152e61179"
"gitHead": "570122c703420680c15f0377fcef6a9368a6043c"
}

@@ -5,7 +5,13 @@ import { DI } from '@aurelia/kernel';

export class AttrSyntax {
constructor(
public readonly rawName: string,
public readonly rawValue: string,
public readonly target: string,
public readonly command: string | null) { }
public readonly rawName: string;
public readonly rawValue: string;
public readonly target: string;
public readonly command: string | null;
constructor(rawName: string, rawValue: string, target: string, command: string | null) {
this.rawName = rawName;
this.rawValue = rawValue;
this.target = target;
this.command = command;
}
}

@@ -12,0 +18,0 @@

@@ -1,4 +0,4 @@

import { Constructable, IContainer, Registration, Writable } from '@aurelia/kernel';
import { BindingType, IExpressionParser, IResourceKind, IResourceType, ITemplateDefinition, TargetedInstruction } from '@aurelia/runtime';
import { Constructable, IContainer, IRegistry, Registration, Writable } from '@aurelia/kernel';
import {
BindingType,
CallBindingInstruction,

@@ -9,9 +9,14 @@ CaptureBindingInstruction,

HydrateTemplateController,
IExpressionParser,
IResourceKind,
IResourceType,
ITemplateDefinition,
IteratorBindingInstruction,
OneTimeBindingInstruction,
SetPropertyInstruction,
TargetedInstruction,
ToViewBindingInstruction,
TriggerBindingInstruction,
TwoWayBindingInstruction
} from './instructions';
} from '@aurelia/runtime';
import { IAttributeSymbol } from './semantic-model';

@@ -43,5 +48,4 @@

// tslint:disable-next-line:no-reserved-keywords
isType<T extends Constructable>(type: T): type is T & IBindingCommandType {
return (type as T & {kind?: unknown}).kind === this;
isType<T extends Constructable & Partial<IBindingCommandType>>(Type: T): Type is T & IBindingCommandType {
return Type.kind === this;
},

@@ -76,3 +80,9 @@

public static inject: Function[] = [IExpressionParser];
constructor(private parser: IExpressionParser) {}
public static register: IRegistry['register'];
private parser: IExpressionParser;
constructor(parser: IExpressionParser) {
this.parser = parser;
}
public compile($symbol: IAttributeSymbol): TargetedInstruction {

@@ -88,3 +98,9 @@ return new OneTimeBindingInstruction(this.parser.parse($symbol.rawValue, BindingType.OneTimeCommand), $symbol.to);

public static inject: Function[] = [IExpressionParser];
constructor(private parser: IExpressionParser) {}
public static register: IRegistry['register'];
private parser: IExpressionParser;
constructor(parser: IExpressionParser) {
this.parser = parser;
}
public compile($symbol: IAttributeSymbol): TargetedInstruction {

@@ -100,3 +116,9 @@ return new ToViewBindingInstruction(this.parser.parse($symbol.rawValue, BindingType.ToViewCommand), $symbol.to);

public static inject: Function[] = [IExpressionParser];
constructor(private parser: IExpressionParser) {}
public static register: IRegistry['register'];
private parser: IExpressionParser;
constructor(parser: IExpressionParser) {
this.parser = parser;
}
public compile($symbol: IAttributeSymbol): TargetedInstruction {

@@ -112,3 +134,9 @@ return new FromViewBindingInstruction(this.parser.parse($symbol.rawValue, BindingType.FromViewCommand), $symbol.to);

public static inject: Function[] = [IExpressionParser];
constructor(private parser: IExpressionParser) {}
public static register: IRegistry['register'];
private parser: IExpressionParser;
constructor(parser: IExpressionParser) {
this.parser = parser;
}
public compile($symbol: IAttributeSymbol): TargetedInstruction {

@@ -128,2 +156,3 @@ return new TwoWayBindingInstruction(this.parser.parse($symbol.rawValue, BindingType.TwoWayCommand), $symbol.to);

public static inject: Function[] = [IExpressionParser];
public static register: IRegistry['register'];
public $1: typeof OneTimeBindingCommand.prototype.compile;

@@ -134,3 +163,10 @@ public $2: typeof ToViewBindingCommand.prototype.compile;

constructor(private parser: IExpressionParser) {}
private parser: IExpressionParser;
constructor(parser: IExpressionParser) {
this.parser = parser;
this.$1 = OneTimeBindingCommand.prototype.compile;
this.$2 = ToViewBindingCommand.prototype.compile;
this.$4 = FromViewBindingCommand.prototype.compile;
this.$6 = TwoWayBindingCommand.prototype.compile;
}

@@ -142,7 +178,2 @@ public compile($symbol: IAttributeSymbol): TargetedInstruction {

DefaultBindingCommand.prototype.$1 = OneTimeBindingCommand.prototype.compile;
DefaultBindingCommand.prototype.$2 = ToViewBindingCommand.prototype.compile;
DefaultBindingCommand.prototype.$4 = FromViewBindingCommand.prototype.compile;
DefaultBindingCommand.prototype.$6 = TwoWayBindingCommand.prototype.compile;
export interface TriggerBindingCommand extends IBindingCommand {}

@@ -153,3 +184,9 @@

public static inject: Function[] = [IExpressionParser];
constructor(private parser: IExpressionParser) {}
public static register: IRegistry['register'];
private parser: IExpressionParser;
constructor(parser: IExpressionParser) {
this.parser = parser;
}
public compile($symbol: IAttributeSymbol): TargetedInstruction {

@@ -165,3 +202,9 @@ return new TriggerBindingInstruction(this.parser.parse($symbol.rawValue, BindingType.TriggerCommand), $symbol.to);

public static inject: Function[] = [IExpressionParser];
constructor(private parser: IExpressionParser) {}
public static register: IRegistry['register'];
private parser: IExpressionParser;
constructor(parser: IExpressionParser) {
this.parser = parser;
}
public compile($symbol: IAttributeSymbol): TargetedInstruction {

@@ -177,3 +220,9 @@ return new DelegateBindingInstruction(this.parser.parse($symbol.rawValue, BindingType.DelegateCommand), $symbol.to);

public static inject: Function[] = [IExpressionParser];
constructor(private parser: IExpressionParser) {}
public static register: IRegistry['register'];
private parser: IExpressionParser;
constructor(parser: IExpressionParser) {
this.parser = parser;
}
public compile($symbol: IAttributeSymbol): TargetedInstruction {

@@ -189,3 +238,9 @@ return new CaptureBindingInstruction(this.parser.parse($symbol.rawValue, BindingType.CaptureCommand), $symbol.to);

public static inject: Function[] = [IExpressionParser];
constructor(private parser: IExpressionParser) {}
public static register: IRegistry['register'];
private parser: IExpressionParser;
constructor(parser: IExpressionParser) {
this.parser = parser;
}
public compile($symbol: IAttributeSymbol): TargetedInstruction {

@@ -199,3 +254,9 @@ return new CallBindingInstruction(this.parser.parse($symbol.rawValue, BindingType.CallCommand), $symbol.to);

public static inject: Function[] = [IExpressionParser];
constructor(private parser: IExpressionParser) {}
public static register: IRegistry['register'];
private parser: IExpressionParser;
constructor(parser: IExpressionParser) {
this.parser = parser;
}
public compile($symbol: IAttributeSymbol): TargetedInstruction {

@@ -207,7 +268,7 @@ const def: ITemplateDefinition = {

};
return new HydrateTemplateController(def, 'repeat', [
const instructions = [
new IteratorBindingInstruction(this.parser.parse($symbol.rawValue, BindingType.ForCommand), 'items'),
new SetPropertyInstruction('item', 'local')
// tslint:disable-next-line:align
], false);
];
return new HydrateTemplateController(def, 'repeat', instructions, false);
}

@@ -214,0 +275,0 @@

@@ -1,2 +0,2 @@

import { IContainer, Registration } from '@aurelia/kernel';
import { IContainer, IRegistry, Registration } from '@aurelia/kernel';
import {

@@ -8,2 +8,3 @@ AttrBindingBehavior,

FromViewBindingBehavior,
HtmlRenderer,
If,

@@ -38,3 +39,3 @@ ITemplateCompiler,

const globalResources: any[] = [
const globalResources: IRegistry[] = [
Compose,

@@ -59,3 +60,3 @@ If,

const defaultBindingLanguage: any[] = [
const defaultBindingLanguage: IRegistry[] = [
DefaultBindingCommand,

@@ -77,2 +78,3 @@ OneTimeBindingCommand,

ParserRegistration,
HtmlRenderer,
Registration.singleton(ITemplateCompiler, TemplateCompiler),

@@ -79,0 +81,0 @@ ...globalResources,

@@ -27,9 +27,20 @@ import { DI, inject, PLATFORM } from '@aurelia/kernel';

export class ElementSyntax {
public readonly node: Node;
public readonly name: string;
public readonly $content: ElementSyntax | null;
public readonly $children: ReadonlyArray<ElementSyntax>;
public readonly $attributes: ReadonlyArray<AttrSyntax>;
constructor(
public readonly node: Node,
public readonly name: string,
public readonly $content: ElementSyntax | null,
public readonly $children: ReadonlyArray<ElementSyntax>,
public readonly $attributes: ReadonlyArray<AttrSyntax>) {
}
node: Node,
name: string,
$content: ElementSyntax | null,
$children: ReadonlyArray<ElementSyntax>,
$attributes: ReadonlyArray<AttrSyntax>) {
this.node = node;
this.name = name;
this.$content = $content;
this.$children = $children;
this.$attributes = $attributes;
}

@@ -51,4 +62,8 @@ public static createMarker(): ElementSyntax {

export class ElementParser implements IElementParser {
constructor(public attrParser: IAttributeParser) {}
public attrParser: IAttributeParser;
constructor(attrParser: IAttributeParser) {
this.attrParser = attrParser;
}
public parse(markupOrNode: string | INode): ElementSyntax {

@@ -55,0 +70,0 @@ let node: INode;

@@ -7,4 +7,3 @@ export * from './attribute-parser';

export * from './expression-parser';
export * from './instructions';
export * from './semantic-model';
export * from './template-compiler';
import { Immutable, IServiceLocator, PLATFORM } from '@aurelia/kernel';
import { BindingMode, CustomAttributeResource, CustomElementResource, DOM, IAttributeDefinition, IBindableDescription, IExpressionParser, IResourceDescriptions, ITemplateDefinition, TargetedInstruction } from '@aurelia/runtime';
import { BindingMode, CustomAttributeResource, CustomElementResource, DOM, HydrateTemplateController, IAttributeDefinition, IBindableDescription, IExpressionParser, IResourceDescriptions, ITemplateDefinition, TargetedInstruction } from '@aurelia/runtime';
import { AttrSyntax, IAttributeParser } from './attribute-parser';

@@ -7,8 +7,12 @@ import { BindingCommandResource, IBindingCommand } from './binding-command';

import { ElementSyntax, IElementParser, NodeType } from './element-parser';
import { HydrateTemplateController } from './instructions';
export class SemanticModel {
public readonly isSemanticModel: true = true;
public readonly isSemanticModel: true;
public readonly root: ElementSymbol;
public resources: IResourceDescriptions;
public attrParser: IAttributeParser;
public elParser: IElementParser;
public exprParser: IExpressionParser;
private readonly attrDefCache: Record<string, IAttributeDefinition>;

@@ -20,7 +24,14 @@ private readonly elDefCache: Record<string, ITemplateDefinition>;

definition: ITemplateDefinition,
public resources: IResourceDescriptions,
public attrParser: IAttributeParser,
public elParser: IElementParser,
public exprParser: IExpressionParser
resources: IResourceDescriptions,
attrParser: IAttributeParser,
elParser: IElementParser,
exprParser: IExpressionParser
) {
this.isSemanticModel = true;
this.resources = resources;
this.attrParser = attrParser;
this.elParser = elParser;
this.exprParser = exprParser;
this.attrDefCache = {};

@@ -137,14 +148,17 @@ this.elDefCache = {};

export interface IAttributeSymbol {
readonly isMultiAttrBinding: boolean;
readonly $element: ElementSymbol;
readonly syntax: AttrSyntax;
readonly command: IBindingCommand | null;
readonly target: string;
readonly res: string | null;
readonly to: string;
readonly mode: BindingMode;
readonly bindable: IBindableDescription;
readonly rawName: string;
readonly rawValue: string;
readonly rawCommand: string;
readonly syntax: AttrSyntax;
readonly command: IBindingCommand | null;
readonly to: string;
readonly mode: BindingMode;
readonly bindable: IBindableDescription;
readonly hasBindingCommand: boolean;
readonly isMultiAttrBinding: boolean;
readonly isHandledByBindingCommand: boolean;

@@ -157,38 +171,65 @@ readonly isTemplateController: boolean;

readonly isElementBindable: boolean;
readonly $element: ElementSymbol;
}
export class MultiAttributeBindingSymbol implements IAttributeSymbol {
public readonly isMultiAttrBinding: boolean = true;
public readonly semanticModel: SemanticModel;
public readonly $parent: AttributeSymbol;
public readonly $element: ElementSymbol;
public readonly syntax: AttrSyntax;
public readonly command: IBindingCommand | null;
public readonly target: string;
public readonly res: string = null;
public readonly res: string;
public readonly to: string;
public readonly mode: BindingMode;
public readonly bindable: Immutable<Required<IBindableDescription>> | null;
public readonly rawName: string;
public readonly rawValue: string;
public readonly rawCommand: string | null;
public readonly to: string;
public readonly mode: BindingMode;
public readonly bindable: Immutable<Required<IBindableDescription>> | null = null;
public readonly hasBindingCommand: boolean;
public readonly isMultiAttrBinding: boolean;
public readonly isHandledByBindingCommand: boolean;
public readonly isTemplateController: boolean = false;
public readonly isCustomAttribute: boolean = true;
public readonly isAttributeBindable: boolean = false;
public readonly isDefaultAttributeBindable: boolean = false;
public readonly onCustomElement: boolean = false;
public readonly isElementBindable: boolean = false;
public readonly $element: ElementSymbol = null;
public readonly isTemplateController: boolean;
public readonly isCustomAttribute: boolean;
public readonly isAttributeBindable: boolean;
public readonly isDefaultAttributeBindable: boolean;
public readonly onCustomElement: boolean;
public readonly isElementBindable: boolean;
constructor(
public readonly semanticModel: SemanticModel,
public readonly $parent: AttributeSymbol,
public readonly syntax: AttrSyntax,
public readonly command: IBindingCommand | null
semanticModel: SemanticModel,
$parent: AttributeSymbol,
syntax: AttrSyntax,
command: IBindingCommand | null
) {
this.semanticModel = semanticModel;
this.$parent = $parent;
this.$element = null;
this.syntax = syntax;
this.command = command;
this.target = syntax.target;
this.res = null;
const parentDefinition = $parent.definition;
// this.to, this.mode and this.bindable will be overridden if there is a matching bindable property
this.to = syntax.target;
this.mode = parentDefinition.defaultBindingMode === undefined ? BindingMode.toView : parentDefinition.defaultBindingMode;
this.bindable = null;
this.rawName = syntax.rawName;
this.rawValue = syntax.rawValue;
this.rawCommand = syntax.command;
this.hasBindingCommand = !!command;
this.isMultiAttrBinding = true;
this.isHandledByBindingCommand = this.hasBindingCommand && command.handles(this);
const bindables = $parent.definition.bindables;
this.isTemplateController = false;
this.isCustomAttribute = true;
this.isAttributeBindable = false;
this.onCustomElement = false;
this.isElementBindable = false;
const bindables = parentDefinition.bindables;
for (const prop in bindables) {

@@ -204,7 +245,2 @@ const b = bindables[prop];

}
if (!this.isAttributeBindable) {
const defaultBindingMode = $parent.definition.defaultBindingMode;
this.to = syntax.target;
this.mode = defaultBindingMode === undefined ? BindingMode.toView : defaultBindingMode;
}
}

@@ -214,21 +250,30 @@ }

export class AttributeSymbol implements IAttributeSymbol {
public readonly isMultiAttrBinding: boolean = false;
public readonly $multiAttrBindings: ReadonlyArray<MultiAttributeBindingSymbol>;
public readonly semanticModel: SemanticModel;
public readonly definition: IAttributeDefinition | null;
public readonly $element: ElementSymbol;
public readonly syntax: AttrSyntax;
public readonly command: IBindingCommand | null;
public readonly target: string;
public readonly res: string | null = null;
public readonly res: string | null;
public readonly to: string;
public readonly mode: BindingMode;
public readonly bindable: Immutable<Required<IBindableDescription>> | null;
public readonly rawName: string;
public readonly rawValue: string;
public readonly rawCommand: string | null;
public readonly to: string;
public readonly mode: BindingMode;
public readonly bindable: Immutable<Required<IBindableDescription>> | null = null;
public readonly isAttributeBindable: boolean = false;
public readonly isDefaultAttributeBindable: boolean = false;
public readonly hasBindingCommand: boolean;
public readonly isMultiAttrBinding: boolean;
public readonly isHandledByBindingCommand: boolean;
public readonly isTemplateController: boolean;
public readonly isCustomAttribute: boolean;
public readonly isElementBindable: boolean = false;
public readonly isAttributeBindable: boolean;
public readonly isDefaultAttributeBindable: boolean;
public readonly onCustomElement: boolean;
public readonly isBindable: boolean = false;
public readonly isTemplateController: boolean = false;
public readonly hasBindingCommand: boolean;
public readonly isHandledByBindingCommand: boolean;
public readonly isElementBindable: boolean;
public readonly $multiAttrBindings: ReadonlyArray<MultiAttributeBindingSymbol>;
public readonly isBindable: boolean;
private _isProcessed: boolean;

@@ -240,17 +285,39 @@ public get isProcessed(): boolean {

constructor(
public readonly semanticModel: SemanticModel,
public readonly $element: ElementSymbol,
public readonly syntax: AttrSyntax,
public readonly definition: IAttributeDefinition | null,
public readonly command: IBindingCommand | null
semanticModel: SemanticModel,
$element: ElementSymbol,
syntax: AttrSyntax,
definition: IAttributeDefinition | null,
command: IBindingCommand | null
) {
this.semanticModel = semanticModel;
this.definition = definition;
this.$element = $element;
this.syntax = syntax;
this.command = command;
this.target = syntax.target;
this.res = null;
// this.to, this.mode and this.bindable will be overridden if there is a matching bindable property
this.to = syntax.target;
this.mode = BindingMode.toView;
this.bindable = null;
this.rawName = syntax.rawName;
this.rawValue = syntax.rawValue;
this.rawCommand = syntax.command;
this.isCustomAttribute = !!definition;
this.hasBindingCommand = !!command;
this.isMultiAttrBinding = false;
this.isHandledByBindingCommand = this.hasBindingCommand && command.handles(this);
this.isTemplateController = false;
this.isCustomAttribute = !!definition;
this.isAttributeBindable = false;
this.isDefaultAttributeBindable = false;
this.onCustomElement = $element.isCustomElement;
this.isElementBindable = false;
this.$multiAttrBindings = PLATFORM.emptyArray;
this.isBindable = false;
this._isProcessed = this.rawName === 'as-element'; // as-element is processed by the semantic model and shouldn't be processed by the template compiler
if (this.isCustomAttribute) {

@@ -283,3 +350,5 @@ this.isTemplateController = !!definition.isTemplateController;

}
this.$multiAttrBindings = this.isMultiAttrBinding ? multiAttrBindings : PLATFORM.emptyArray;
if (this.isMultiAttrBinding) {
this.$multiAttrBindings = multiAttrBindings;
}
const bindables = definition.bindables;

@@ -318,5 +387,2 @@ if (!this.isMultiAttrBinding) {

}
} else {
this.to = syntax.target;
this.mode = BindingMode.toView;
}

@@ -334,2 +400,8 @@ }

export class ElementSymbol {
public readonly semanticModel: SemanticModel;
public readonly isRoot: boolean;
public readonly $root: ElementSymbol;
public readonly $parent: ElementSymbol;
public readonly definition: ITemplateDefinition | null;
public readonly $attributes: ReadonlyArray<AttributeSymbol>;

@@ -388,7 +460,7 @@ public readonly $children: ReadonlyArray<ElementSymbol>;

}
private _$content: ElementSymbol = null;
private _isMarker: boolean = false;
private _isTemplate: boolean = false;
private _isSlot: boolean = false;
private _isLet: boolean = false;
private _$content: ElementSymbol;
private _isMarker: boolean;
private _isTemplate: boolean;
private _isSlot: boolean;
private _isLet: boolean;
private _node: Node;

@@ -398,16 +470,29 @@ private _syntax: ElementSyntax;

private _isCustomElement: boolean;
private _isLifted: boolean = false;
private _isLifted: boolean;
constructor(
public readonly semanticModel: SemanticModel,
public readonly isRoot: boolean,
public readonly $root: ElementSymbol,
public readonly $parent: ElementSymbol,
semanticModel: SemanticModel,
isRoot: boolean,
$root: ElementSymbol,
$parent: ElementSymbol,
syntax: ElementSyntax,
public readonly definition: ITemplateDefinition | null
definition: ITemplateDefinition | null
) {
this.semanticModel = semanticModel;
this.isRoot = isRoot;
this.$root = isRoot ? this : $root;
this.$parent = $parent;
this.definition = definition;
this._$content = null;
this._isMarker = false;
this._isTemplate = false;
this._isSlot = false;
this._isLet = false;
this._node = syntax.node;
this._syntax = syntax;
this._name = this.node.nodeName;
this._isCustomElement = false;
this._isLifted = false;
switch (this.name) {

@@ -414,0 +499,0 @@ case 'TEMPLATE':

@@ -5,20 +5,12 @@ import { inject, PLATFORM } from '@aurelia/kernel';

BindingType,
FromViewBindingInstruction,
HydrateAttributeInstruction,
HydrateElementInstruction,
HydrateTemplateController,
IExpressionParser,
ILetBindingInstruction,
InterpolationInstruction,
IResourceDescriptions,
ITemplateCompiler,
ITemplateDefinition,
TargetedInstruction,
TargetedInstructionType,
TemplateDefinition,
ViewCompileFlags
} from '@aurelia/runtime';
import { IAttributeParser } from './attribute-parser';
import { IElementParser, NodeType } from './element-parser';
import {
FromViewBindingInstruction,
HydrateAttributeInstruction,
HydrateElementInstruction,
HydrateTemplateController,
InterpolationInstruction,
LetBindingInstruction,

@@ -30,6 +22,12 @@ LetElementInstruction,

SetPropertyInstruction,
TargetedInstruction,
TargetedInstructionType,
TemplateDefinition,
TextBindingInstruction,
ToViewBindingInstruction,
TwoWayBindingInstruction
} from './instructions';
TwoWayBindingInstruction,
ViewCompileFlags
} from '@aurelia/runtime';
import { IAttributeParser } from './attribute-parser';
import { IElementParser, NodeType } from './element-parser';
import { AttributeSymbol, ElementSymbol, IAttributeSymbol, SemanticModel } from './semantic-model';

@@ -39,2 +37,6 @@

export class TemplateCompiler implements ITemplateCompiler {
public exprParser: IExpressionParser;
public elParser: IElementParser;
public attrParser: IAttributeParser;
public get name(): string {

@@ -44,3 +46,7 @@ return 'default';

constructor(public exprParser: IExpressionParser, public elParser: IElementParser, public attrParser: IAttributeParser) { }
constructor(exprParser: IExpressionParser, elParser: IElementParser, attrParser: IAttributeParser) {
this.exprParser = exprParser;
this.elParser = elParser;
this.attrParser = attrParser;
}

@@ -47,0 +53,0 @@ public compile(definition: ITemplateDefinition, resources: IResourceDescriptions, flags?: ViewCompileFlags): TemplateDefinition {

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

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 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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc