chore: remove ENUM_INDEX from facade
The ENUM_INDEX utility was added to return the index of an enum consistently between Dart and TypeScript, so that the index could be used to look up the name of the enum. Since dart is no longer supported by Http, and since no other part of the framework is using this function, it has been removed. Closes #3843
This commit is contained in:

committed by
Jeff Cross

parent
51285666d8
commit
256b2dc9b7
@ -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;
|
||||
|
@ -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)
|
||||
|
Reference in New Issue
Block a user