mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-16 20:11:24 +08:00
fix: XHR readystatechange event
This commit is contained in:
@ -166,7 +166,7 @@ export class XMLHttpRequest {
|
|||||||
private _listeners: Map<string, Array<Function>> = new Map<string, Array<Function>>();
|
private _listeners: Map<string, Array<Function>> = new Map<string, Array<Function>>();
|
||||||
|
|
||||||
public addEventListener(eventName: string, handler: Function) {
|
public addEventListener(eventName: string, handler: Function) {
|
||||||
if (eventName !== "load" && eventName !== "error" && eventName !== "progress") {
|
if (["abort", "error", "load", "loadend", "loadstart", "progress", "readystatechange"].indexOf(eventName) === -1) {
|
||||||
throw new Error("Event not supported: " + eventName);
|
throw new Error("Event not supported: " + eventName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user