Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ cache:
- $HOME/.pub-cache
- $HOME/.chrome/chromium

before_cache:
# Undo the pollution of the typescript_next build before the cache is primed for future use
- if [[ "$MODE" == "typescript_next" ]]; then npm install typescript; fi

env:
global:
# Use newer verison of GCC to that is required to compile native npm modules for Node v4+ on Ubuntu Precise
Expand Down Expand Up @@ -56,7 +52,6 @@ env:
- MODE=js
- MODE=router
- MODE=build_only
- MODE=typescript_next
- MODE=lint

matrix:
Expand Down
4 changes: 2 additions & 2 deletions modules/angular2/platform/browser_static.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export {
disableDebugTools
} from 'angular2/src/platform/browser_common';

import {Type, isPresent} from 'angular2/src/facade/lang';
import {Type, isPresent, CONST_EXPR} from 'angular2/src/facade/lang';
import {
BROWSER_PROVIDERS,
BROWSER_APP_COMMON_PROVIDERS
Expand All @@ -24,7 +24,7 @@ import {ComponentRef, platform} from 'angular2/core';
* have been precompiled offline.
*/
export const BROWSER_APP_PROVIDERS: Array<any /*Type | Provider | any[]*/> =
BROWSER_APP_COMMON_PROVIDERS;
CONST_EXPR(BROWSER_APP_COMMON_PROVIDERS);

/**
* See {@link bootstrap} for more information.
Expand Down
2 changes: 1 addition & 1 deletion modules/angular2/platform/worker_render.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export 'package:angular2/src/platform/worker_render_common.dart'
initializeGenericWorkerRenderer;

export 'package:angular2/src/platform/worker_render.dart'
show WORKER_RENDER_APPLICATION, initIsolate, WebWorkerInstance;
show initIsolate, WebWorkerInstance;

export '../src/web_workers/shared/client_message_broker.dart'
show ClientMessageBroker, ClientMessageBrokerFactory, FnArg, UiArguments;
Expand Down
2 changes: 1 addition & 1 deletion modules/angular2/src/common/forms/directives/validators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import {NumberWrapper} from "angular2/src/facade/lang";
*/
export interface Validator { validate(c: modelModule.AbstractControl): {[key: string]: any}; }

const REQUIRED = Validators.required;
const REQUIRED = CONST_EXPR(Validators.required);

const REQUIRED_VALIDATOR =
CONST_EXPR(new Provider(NG_VALIDATORS, {useValue: REQUIRED, multi: true}));
Expand Down
110 changes: 56 additions & 54 deletions modules/angular2/src/compiler/chars.ts
Original file line number Diff line number Diff line change
@@ -1,63 +1,65 @@
export const $EOF = 0;
export const $TAB = 9;
export const $LF = 10;
export const $VTAB = 11;
export const $FF = 12;
export const $CR = 13;
export const $SPACE = 32;
export const $BANG = 33;
export const $DQ = 34;
export const $HASH = 35;
export const $$ = 36;
export const $PERCENT = 37;
export const $AMPERSAND = 38;
export const $SQ = 39;
export const $LPAREN = 40;
export const $RPAREN = 41;
export const $STAR = 42;
export const $PLUS = 43;
export const $COMMA = 44;
export const $MINUS = 45;
export const $PERIOD = 46;
export const $SLASH = 47;
export const $COLON = 58;
export const $SEMICOLON = 59;
export const $LT = 60;
export const $EQ = 61;
export const $GT = 62;
export const $QUESTION = 63;
import {CONST_EXPR} from 'angular2/src/facade/lang';

export const $0 = 48;
export const $9 = 57;
export const $EOF = CONST_EXPR(0);
export const $TAB = CONST_EXPR(9);
export const $LF = CONST_EXPR(10);
export const $VTAB = CONST_EXPR(11);
export const $FF = CONST_EXPR(12);
export const $CR = CONST_EXPR(13);
export const $SPACE = CONST_EXPR(32);
export const $BANG = CONST_EXPR(33);
export const $DQ = CONST_EXPR(34);
export const $HASH = CONST_EXPR(35);
export const $$ = CONST_EXPR(36);
export const $PERCENT = CONST_EXPR(37);
export const $AMPERSAND = CONST_EXPR(38);
export const $SQ = CONST_EXPR(39);
export const $LPAREN = CONST_EXPR(40);
export const $RPAREN = CONST_EXPR(41);
export const $STAR = CONST_EXPR(42);
export const $PLUS = CONST_EXPR(43);
export const $COMMA = CONST_EXPR(44);
export const $MINUS = CONST_EXPR(45);
export const $PERIOD = CONST_EXPR(46);
export const $SLASH = CONST_EXPR(47);
export const $COLON = CONST_EXPR(58);
export const $SEMICOLON = CONST_EXPR(59);
export const $LT = CONST_EXPR(60);
export const $EQ = CONST_EXPR(61);
export const $GT = CONST_EXPR(62);
export const $QUESTION = CONST_EXPR(63);

export const $A = 65;
export const $E = 69;
export const $Z = 90;
export const $0 = CONST_EXPR(48);
export const $9 = CONST_EXPR(57);

export const $LBRACKET = 91;
export const $BACKSLASH = 92;
export const $RBRACKET = 93;
export const $CARET = 94;
export const $_ = 95;
export const $A = CONST_EXPR(65);
export const $E = CONST_EXPR(69);
export const $Z = CONST_EXPR(90);

export const $a = 97;
export const $e = 101;
export const $f = 102;
export const $n = 110;
export const $r = 114;
export const $t = 116;
export const $u = 117;
export const $v = 118;
export const $z = 122;
export const $LBRACKET = CONST_EXPR(91);
export const $BACKSLASH = CONST_EXPR(92);
export const $RBRACKET = CONST_EXPR(93);
export const $CARET = CONST_EXPR(94);
export const $_ = CONST_EXPR(95);

export const $LBRACE = 123;
export const $BAR = 124;
export const $RBRACE = 125;
export const $NBSP = 160;
export const $a = CONST_EXPR(97);
export const $e = CONST_EXPR(101);
export const $f = CONST_EXPR(102);
export const $n = CONST_EXPR(110);
export const $r = CONST_EXPR(114);
export const $t = CONST_EXPR(116);
export const $u = CONST_EXPR(117);
export const $v = CONST_EXPR(118);
export const $z = CONST_EXPR(122);

export const $PIPE = 124;
export const $TILDA = 126;
export const $AT = 64;
export const $LBRACE = CONST_EXPR(123);
export const $BAR = CONST_EXPR(124);
export const $RBRACE = CONST_EXPR(125);
export const $NBSP = CONST_EXPR(160);

export const $PIPE = CONST_EXPR(124);
export const $TILDA = CONST_EXPR(126);
export const $AT = CONST_EXPR(64);

export function isWhitespace(code: number): boolean {
return (code >= $TAB && code <= $SPACE) || (code == $NBSP);
Expand Down
5 changes: 3 additions & 2 deletions modules/angular2/src/compiler/selector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ import {
isBlank,
RegExpWrapper,
RegExpMatcherWrapper,
StringWrapper
StringWrapper,
CONST_EXPR
} from 'angular2/src/facade/lang';
import {BaseException, WrappedException} from 'angular2/src/facade/exceptions';

const _EMPTY_ATTR_VALUE = '';
const _EMPTY_ATTR_VALUE = CONST_EXPR('');

// TODO: Can't use `const` here as
// in Dart this is not transpiled into `final` yet...
Expand Down
62 changes: 33 additions & 29 deletions modules/angular2/src/core/application_ref.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,34 +38,38 @@ import {ElementRef_} from 'angular2/src/core/linker/element_ref';
* Construct providers specific to an individual root component.
*/
function _componentProviders(appComponentType: Type): Array<Type | Provider | any[]> {
return [
provide(APP_COMPONENT, {useValue: appComponentType}),
provide(APP_COMPONENT_REF_PROMISE,
{
useFactory: (dynamicComponentLoader: DynamicComponentLoader, appRef: ApplicationRef_,
injector: Injector) => {
// Save the ComponentRef for disposal later.
var ref: ComponentRef;
// TODO(rado): investigate whether to support providers on root component.
return dynamicComponentLoader.loadAsRoot(appComponentType, null, injector,
() => { appRef._unloadComponent(ref); })
.then((componentRef) => {
ref = componentRef;
var testability = injector.getOptional(Testability);
if (isPresent(testability)) {
injector.get(TestabilityRegistry)
.registerApplication(componentRef.location.nativeElement, testability);
}
return componentRef;
});
},
deps: [DynamicComponentLoader, ApplicationRef, Injector]
}),
provide(appComponentType,
{
useFactory: (p: Promise<any>) => p.then(ref => ref.instance),
deps: [APP_COMPONENT_REF_PROMISE]
}),
return <any[]>[provide(APP_COMPONENT, {useValue: appComponentType}),
provide(APP_COMPONENT_REF_PROMISE,
{
useFactory: (dynamicComponentLoader: DynamicComponentLoader,
appRef: ApplicationRef_, injector: Injector) => {
// Save the ComponentRef for disposal later.
var ref: ComponentRef;
// TODO(rado): investigate whether to support providers on root
// component.
return dynamicComponentLoader.loadAsRoot(
appComponentType, null, injector,
() => {
appRef._unloadComponent(ref);
})
.then((componentRef) => {
ref = componentRef;
var testability = injector.getOptional(Testability);
if (isPresent(testability)) {
injector.get(TestabilityRegistry)
.registerApplication(componentRef.location.nativeElement,
testability);
}
return componentRef;
});
},
deps: [DynamicComponentLoader, ApplicationRef, Injector]
}),
provide(appComponentType,
{
useFactory: (p: Promise<any>) => p.then(ref => ref.instance),
deps: [APP_COMPONENT_REF_PROMISE]
}),
];
}

Expand Down Expand Up @@ -446,7 +450,7 @@ export class ApplicationRef_ extends ApplicationRef {
}
});
return completer.promise.then<ComponentRef>((ref: ComponentRef) => {
let c = this._injector.get(Console);
let c: Console = this._injector.get(Console);
if (assertionsEnabled()) {
c.log(
"Angular 2 is running in the development mode. Call enableProdMode() to enable the production mode.");
Expand Down
102 changes: 55 additions & 47 deletions modules/angular2/src/core/change_detection/parser/lexer.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
import {Injectable} from 'angular2/src/core/di/decorators';
import {ListWrapper, SetWrapper} from "angular2/src/facade/collection";
import {NumberWrapper, StringJoiner, StringWrapper, isPresent} from "angular2/src/facade/lang";
import {
NumberWrapper,
StringJoiner,
StringWrapper,
isPresent,
CONST_EXPR
} from "angular2/src/facade/lang";
import {BaseException} from 'angular2/src/facade/exceptions';

export enum TokenType {
Expand Down Expand Up @@ -106,52 +112,54 @@ function newNumberToken(index: number, n: number): Token {

export var EOF: Token = new Token(-1, TokenType.Character, 0, "");

export const $EOF = 0;
export const $TAB = 9;
export const $LF = 10;
export const $VTAB = 11;
export const $FF = 12;
export const $CR = 13;
export const $SPACE = 32;
export const $BANG = 33;
export const $DQ = 34;
export const $HASH = 35;
export const $$ = 36;
export const $PERCENT = 37;
export const $AMPERSAND = 38;
export const $SQ = 39;
export const $LPAREN = 40;
export const $RPAREN = 41;
export const $STAR = 42;
export const $PLUS = 43;
export const $COMMA = 44;
export const $MINUS = 45;
export const $PERIOD = 46;
export const $SLASH = 47;
export const $COLON = 58;
export const $SEMICOLON = 59;
export const $LT = 60;
export const $EQ = 61;
export const $GT = 62;
export const $QUESTION = 63;

const $0 = 48;
const $9 = 57;

const $A = 65, $E = 69, $Z = 90;

export const $LBRACKET = 91;
export const $BACKSLASH = 92;
export const $RBRACKET = 93;
const $CARET = 94;
const $_ = 95;
export const $BT = 96;
const $a = 97, $e = 101, $f = 102, $n = 110, $r = 114, $t = 116, $u = 117, $v = 118, $z = 122;

export const $LBRACE = 123;
export const $BAR = 124;
export const $RBRACE = 125;
const $NBSP = 160;
export const $EOF = CONST_EXPR(CONST_EXPR(0));
export const $TAB = CONST_EXPR(9);
export const $LF = CONST_EXPR(10);
export const $VTAB = CONST_EXPR(11);
export const $FF = CONST_EXPR(12);
export const $CR = CONST_EXPR(13);
export const $SPACE = CONST_EXPR(32);
export const $BANG = CONST_EXPR(33);
export const $DQ = CONST_EXPR(34);
export const $HASH = CONST_EXPR(35);
export const $$ = CONST_EXPR(36);
export const $PERCENT = CONST_EXPR(37);
export const $AMPERSAND = CONST_EXPR(38);
export const $SQ = CONST_EXPR(39);
export const $LPAREN = CONST_EXPR(40);
export const $RPAREN = CONST_EXPR(41);
export const $STAR = CONST_EXPR(42);
export const $PLUS = CONST_EXPR(43);
export const $COMMA = CONST_EXPR(44);
export const $MINUS = CONST_EXPR(45);
export const $PERIOD = CONST_EXPR(46);
export const $SLASH = CONST_EXPR(47);
export const $COLON = CONST_EXPR(58);
export const $SEMICOLON = CONST_EXPR(59);
export const $LT = CONST_EXPR(60);
export const $EQ = CONST_EXPR(61);
export const $GT = CONST_EXPR(62);
export const $QUESTION = CONST_EXPR(63);

const $0 = CONST_EXPR(48);
const $9 = CONST_EXPR(57);

const $A = CONST_EXPR(65), $E = CONST_EXPR(69), $Z = CONST_EXPR(90);

export const $LBRACKET = CONST_EXPR(91);
export const $BACKSLASH = CONST_EXPR(92);
export const $RBRACKET = CONST_EXPR(93);
const $CARET = CONST_EXPR(94);
const $_ = CONST_EXPR(95);
export const $BT = CONST_EXPR(96);
const $a = CONST_EXPR(97), $e = CONST_EXPR(101), $f = CONST_EXPR(102), $n = CONST_EXPR(110),
$r = CONST_EXPR(114), $t = CONST_EXPR(116), $u = CONST_EXPR(117), $v = CONST_EXPR(118),
$z = CONST_EXPR(122);

export const $LBRACE = CONST_EXPR(123);
export const $BAR = CONST_EXPR(124);
export const $RBRACE = CONST_EXPR(125);
const $NBSP = CONST_EXPR(160);

export class ScannerError extends BaseException {
constructor(public message) { super(); }
Expand Down
2 changes: 1 addition & 1 deletion modules/angular2/src/upgrade/downgrade_ng2_adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ export class DowngradeNg2ComponentAdapter {
}

if (expr != null && assignExpr != null) {
var getter = this.parse(expr);
var getter = <any>this.parse(expr);
var setter = getter.assign;
if (assignExpr && !setter) {
throw new Error(`Expression '${expr}' is not assignable!`);
Expand Down
1 change: 0 additions & 1 deletion modules/angular2/test/common/pipes/json_pipe_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {
afterEach,
AsyncTestCompleter,
inject,
proxy,
TestComponentBuilder
} from 'angular2/testing_internal';
import {Json, RegExp, NumberWrapper, StringWrapper} from 'angular2/src/facade/lang';
Expand Down
Loading