avm2: Stub URLRequest.data

This allows Wonderputt to get further (it deliberately assigns
'null' to 'URLRequest.data'). We throw an exception for any other
value, to prevent confusing errors caused by attempting an
unexpected request to a web server with a missig body.
This commit is contained in:
Aaron Hill 2022-08-11 18:31:39 -05:00 committed by Adrian Wielgosik
parent 9d1f27484b
commit 91993eb872
1 changed files with 12 additions and 0 deletions

View File

@ -6,6 +6,7 @@ package flash.net {
// FIXME - this should be a getter/setter for consistency with Flash
public var url:String;
private var _method:String;
private var _data:Object;
public function URLRequest(url:String = null) {
this.url = url;
@ -19,5 +20,16 @@ package flash.net {
// FIXME - perform validation here
this._method = newMethod;
}
public function get data():Object {
return this._data;
}
public function set data(newData:Object):void {
if (newData !== null) {
throw new Error("URLRequest.data setter is not yet implemented!");
}
this._data = newData;
}
}
}