Use QName::dynamic_name
This commit is contained in:
parent
7a870ad10a
commit
d3689de25d
|
@ -30,12 +30,12 @@ fn instance_init<'gc>(
|
||||||
if let Some(mut this) = this {
|
if let Some(mut this) = this {
|
||||||
activation.super_init(this, &[])?;
|
activation.super_init(this, &[])?;
|
||||||
this.set_property(
|
this.set_property(
|
||||||
&QName::new(Namespace::public(), "dataFormat").into(),
|
&QName::dynamic_name("dataFormat").into(),
|
||||||
"text".into(),
|
"text".into(),
|
||||||
activation,
|
activation,
|
||||||
)?;
|
)?;
|
||||||
this.set_property(
|
this.set_property(
|
||||||
&QName::new(Namespace::public(), "data").into(),
|
&QName::dynamic_name("data").into(),
|
||||||
Value::Undefined,
|
Value::Undefined,
|
||||||
activation,
|
activation,
|
||||||
)?;
|
)?;
|
||||||
|
@ -67,8 +67,7 @@ fn bytes_total<'gc>(
|
||||||
_args: &[Value<'gc>],
|
_args: &[Value<'gc>],
|
||||||
) -> Result<Value<'gc>, Error> {
|
) -> Result<Value<'gc>, Error> {
|
||||||
if let Some(this) = this {
|
if let Some(this) = this {
|
||||||
let data =
|
let data = this.get_property(&QName::dynamic_name("data").into(), activation)?;
|
||||||
this.get_property(&QName::new(Namespace::public(), "data").into(), activation)?;
|
|
||||||
|
|
||||||
if let Value::Object(data) = data {
|
if let Value::Object(data) = data {
|
||||||
// `bytesTotal` should be 0 while the download is in progress
|
// `bytesTotal` should be 0 while the download is in progress
|
||||||
|
@ -99,10 +98,7 @@ fn load<'gc>(
|
||||||
};
|
};
|
||||||
|
|
||||||
let data_format = this
|
let data_format = this
|
||||||
.get_property(
|
.get_property(&QName::dynamic_name("dataFormat").into(), activation)?
|
||||||
&QName::new(Namespace::public(), "dataFormat").into(),
|
|
||||||
activation,
|
|
||||||
)?
|
|
||||||
.coerce_to_string(activation)?;
|
.coerce_to_string(activation)?;
|
||||||
|
|
||||||
let data_format = if data_format == AvmString::from("binary") {
|
let data_format = if data_format == AvmString::from("binary") {
|
||||||
|
@ -127,7 +123,7 @@ fn spawn_fetch<'gc>(
|
||||||
data_format: DataFormat,
|
data_format: DataFormat,
|
||||||
) -> Result<Value<'gc>, Error> {
|
) -> Result<Value<'gc>, Error> {
|
||||||
let url = url_request
|
let url = url_request
|
||||||
.get_property(&QName::new(Namespace::public(), "url").into(), activation)?
|
.get_property(&QName::dynamic_name("url").into(), activation)?
|
||||||
.coerce_to_string(activation)?;
|
.coerce_to_string(activation)?;
|
||||||
|
|
||||||
let url = url.to_utf8_lossy();
|
let url = url.to_utf8_lossy();
|
||||||
|
|
Loading…
Reference in New Issue