fix(Dart): make some playground samples run with Dart Dev Compiler
Resolve all invalid field override errors, workaround current reflection limitations in Dart Dev Compiler. todo, hello_world and key_events samples now work with Dart Dev Compiler. BREAKING CHANGE: remove TemplateRef.elementRef setter Closes #6441
This commit is contained in:
parent
a4b5cb8376
commit
3e65d1458e
@ -25,7 +25,7 @@ export abstract class TemplateRef {
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
// TODO(i): rename to anchor or location
|
// TODO(i): rename to anchor or location
|
||||||
elementRef: ElementRef;
|
get elementRef(): ElementRef { return null; }
|
||||||
}
|
}
|
||||||
|
|
||||||
export class TemplateRef_ extends TemplateRef {
|
export class TemplateRef_ extends TemplateRef {
|
||||||
|
@ -4,9 +4,11 @@ import 'exception_handler.dart';
|
|||||||
export 'exception_handler.dart';
|
export 'exception_handler.dart';
|
||||||
|
|
||||||
class BaseException extends Error {
|
class BaseException extends Error {
|
||||||
final String message;
|
final String _message;
|
||||||
|
|
||||||
BaseException([this.message]);
|
BaseException([this._message]);
|
||||||
|
|
||||||
|
String get message => _message;
|
||||||
|
|
||||||
String toString() {
|
String toString() {
|
||||||
return this.message;
|
return this.message;
|
||||||
@ -14,16 +16,16 @@ class BaseException extends Error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class WrappedException extends Error {
|
class WrappedException extends Error {
|
||||||
final dynamic context;
|
final dynamic _context;
|
||||||
final String wrapperMessage;
|
final String _wrapperMessage;
|
||||||
final originalException;
|
final originalException;
|
||||||
final originalStack;
|
final originalStack;
|
||||||
|
|
||||||
WrappedException(
|
WrappedException(
|
||||||
[this.wrapperMessage,
|
[this._wrapperMessage,
|
||||||
this.originalException,
|
this.originalException,
|
||||||
this.originalStack,
|
this.originalStack,
|
||||||
this.context]);
|
this._context]);
|
||||||
|
|
||||||
get message {
|
get message {
|
||||||
return ExceptionHandler.exceptionToString(this);
|
return ExceptionHandler.exceptionToString(this);
|
||||||
@ -32,6 +34,10 @@ class WrappedException extends Error {
|
|||||||
String toString() {
|
String toString() {
|
||||||
return this.message;
|
return this.message;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dynamic get context => _context;
|
||||||
|
|
||||||
|
String get wrapperMessage => _wrapperMessage;
|
||||||
}
|
}
|
||||||
|
|
||||||
Error makeTypeError([String message = ""]) {
|
Error makeTypeError([String message = ""]) {
|
||||||
|
@ -30,7 +30,10 @@ export abstract class DomAdapter {
|
|||||||
* Maps attribute names to their corresponding property names for cases
|
* Maps attribute names to their corresponding property names for cases
|
||||||
* where attribute name doesn't match property name.
|
* where attribute name doesn't match property name.
|
||||||
*/
|
*/
|
||||||
attrToPropMap: {[key: string]: string};
|
get attrToPropMap(): {[key: string]: string} { return this._attrToPropMap; };
|
||||||
|
set attrToPropMap(value: {[key: string]: string}) { this._attrToPropMap = value; };
|
||||||
|
/** @internal */
|
||||||
|
_attrToPropMap: {[key: string]: string};
|
||||||
|
|
||||||
abstract parse(templateHtml: string);
|
abstract parse(templateHtml: string);
|
||||||
abstract query(selector: string): any;
|
abstract query(selector: string): any;
|
||||||
|
@ -4,8 +4,6 @@ import {EventManagerPlugin, EventManager} from './event_manager';
|
|||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class DomEventsPlugin extends EventManagerPlugin {
|
export class DomEventsPlugin extends EventManagerPlugin {
|
||||||
manager: EventManager;
|
|
||||||
|
|
||||||
// This plugin should come last in the list of plugins, because it accepts all
|
// This plugin should come last in the list of plugins, because it accepts all
|
||||||
// events.
|
// events.
|
||||||
supports(eventName: string): boolean { return true; }
|
supports(eventName: string): boolean { return true; }
|
||||||
|
@ -1224,7 +1224,6 @@ var NG_CORE = [
|
|||||||
'SimpleChange.isFirstChange()',
|
'SimpleChange.isFirstChange()',
|
||||||
'TemplateRef',
|
'TemplateRef',
|
||||||
'TemplateRef.elementRef',
|
'TemplateRef.elementRef',
|
||||||
'TemplateRef.elementRef=',
|
|
||||||
/*
|
/*
|
||||||
Abstract method
|
Abstract method
|
||||||
'TemplateRef.hasLocal()',
|
'TemplateRef.hasLocal()',
|
||||||
|
@ -225,7 +225,7 @@ class _CodegenState {
|
|||||||
List<String> codes = [];
|
List<String> codes = [];
|
||||||
_endOfBlockIdxs.clear();
|
_endOfBlockIdxs.clear();
|
||||||
|
|
||||||
ListWrapper.forEachWithIndex(eb.records, (r, i) {
|
ListWrapper.forEachWithIndex(eb.records, (_, i) {
|
||||||
var code;
|
var code;
|
||||||
var r = eb.records[i];
|
var r = eb.records[i];
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user