diff --git a/modules/angular2/src/core/facade/lang.dart b/modules/angular2/src/core/facade/lang.dart index 7c0a40c323..0a678e9474 100644 --- a/modules/angular2/src/core/facade/lang.dart +++ b/modules/angular2/src/core/facade/lang.dart @@ -13,8 +13,6 @@ class Math { static double random() => _random.nextDouble(); } -int ENUM_INDEX(value) => value.index; - class CONST { const CONST(); } diff --git a/modules/angular2/src/core/facade/lang.ts b/modules/angular2/src/core/facade/lang.ts index 222eb39bbe..878698eb45 100644 --- a/modules/angular2/src/core/facade/lang.ts +++ b/modules/angular2/src/core/facade/lang.ts @@ -53,10 +53,6 @@ _global.assert = function assert(condition) { } }; -export function ENUM_INDEX(value: number): number { - return value; -} - // This function is needed only to properly support Dart's const expressions // see https://github.com/angular/ts2dart/pull/151 for more info export function CONST_EXPR(expr: T): T { diff --git a/modules/angular2/src/http/backends/jsonp_backend.ts b/modules/angular2/src/http/backends/jsonp_backend.ts index 9ef2a8fa6c..aa7e657327 100644 --- a/modules/angular2/src/http/backends/jsonp_backend.ts +++ b/modules/angular2/src/http/backends/jsonp_backend.ts @@ -6,7 +6,7 @@ import {ResponseOptions, BaseResponseOptions} from '../base_response_options'; import {Injectable} from 'angular2/di'; import {BrowserJsonp} from './browser_jsonp'; import {EventEmitter, ObservableWrapper} from 'angular2/src/core/facade/async'; -import {StringWrapper, isPresent, ENUM_INDEX, makeTypeError} from 'angular2/src/core/facade/lang'; +import {StringWrapper, isPresent, makeTypeError} from 'angular2/src/core/facade/lang'; export class JSONPConnection implements Connection { readyState: ReadyStates; diff --git a/modules/angular2/src/http/backends/xhr_backend.ts b/modules/angular2/src/http/backends/xhr_backend.ts index 3722382474..70128e76c3 100644 --- a/modules/angular2/src/http/backends/xhr_backend.ts +++ b/modules/angular2/src/http/backends/xhr_backend.ts @@ -6,7 +6,7 @@ import {ResponseOptions, BaseResponseOptions} from '../base_response_options'; import {Injectable} from 'angular2/di'; import {BrowserXhr} from './browser_xhr'; import {EventEmitter, ObservableWrapper} from 'angular2/src/core/facade/async'; -import {isPresent, ENUM_INDEX} from 'angular2/src/core/facade/lang'; +import {isPresent} from 'angular2/src/core/facade/lang'; /** * Creates connections using `XMLHttpRequest`. Given a fully-qualified @@ -31,7 +31,7 @@ export class XHRConnection implements Connection { this.response = new EventEmitter(); this._xhr = browserXHR.build(); // TODO(jeffbcross): implement error listening/propagation - this._xhr.open(RequestMethods[ENUM_INDEX(req.method)], req.url); + this._xhr.open(RequestMethods[req.method], req.url); this._xhr.addEventListener('load', (_) => { // responseText is the old-school way of retrieving response (supported by IE8 & 9) // response/responseType properties were introduced in XHR Level2 spec (supported by IE10)