avm1: Make FunctionObject::function_and_constructor require prototype, it's not optional
This commit is contained in:
parent
88a31cc5a9
commit
691e3b6804
|
@ -516,14 +516,14 @@ impl<'gc> FunctionObject<'gc> {
|
||||||
function: impl Into<Executable<'gc>>,
|
function: impl Into<Executable<'gc>>,
|
||||||
constructor: impl Into<Executable<'gc>>,
|
constructor: impl Into<Executable<'gc>>,
|
||||||
fn_proto: Option<Object<'gc>>,
|
fn_proto: Option<Object<'gc>>,
|
||||||
prototype: Option<Object<'gc>>,
|
prototype: Object<'gc>,
|
||||||
) -> Object<'gc> {
|
) -> Object<'gc> {
|
||||||
Self::allocate_function(
|
Self::allocate_function(
|
||||||
context,
|
context,
|
||||||
Some(function),
|
Some(function),
|
||||||
Some(constructor),
|
Some(constructor),
|
||||||
fn_proto,
|
fn_proto,
|
||||||
prototype,
|
Some(prototype),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -353,7 +353,7 @@ pub fn create_globals<'gc>(
|
||||||
Some(function_proto),
|
Some(function_proto),
|
||||||
Some(text_format_proto),
|
Some(text_format_proto),
|
||||||
);
|
);
|
||||||
let array = array::create_array_object(gc_context, Some(array_proto), Some(function_proto));
|
let array = array::create_array_object(gc_context, array_proto, Some(function_proto));
|
||||||
let xmlnode = FunctionObject::constructor(
|
let xmlnode = FunctionObject::constructor(
|
||||||
gc_context,
|
gc_context,
|
||||||
Executable::Native(xml::xmlnode_constructor),
|
Executable::Native(xml::xmlnode_constructor),
|
||||||
|
@ -366,10 +366,9 @@ pub fn create_globals<'gc>(
|
||||||
Some(function_proto),
|
Some(function_proto),
|
||||||
Some(xml_proto),
|
Some(xml_proto),
|
||||||
);
|
);
|
||||||
let string = string::create_string_object(gc_context, Some(string_proto), Some(function_proto));
|
let string = string::create_string_object(gc_context, string_proto, Some(function_proto));
|
||||||
let number = number::create_number_object(gc_context, Some(number_proto), Some(function_proto));
|
let number = number::create_number_object(gc_context, number_proto, Some(function_proto));
|
||||||
let boolean =
|
let boolean = boolean::create_boolean_object(gc_context, boolean_proto, Some(function_proto));
|
||||||
boolean::create_boolean_object(gc_context, Some(boolean_proto), Some(function_proto));
|
|
||||||
|
|
||||||
let flash = ScriptObject::object(gc_context, Some(object_proto));
|
let flash = ScriptObject::object(gc_context, Some(object_proto));
|
||||||
let geom = ScriptObject::object(gc_context, Some(object_proto));
|
let geom = ScriptObject::object(gc_context, Some(object_proto));
|
||||||
|
|
|
@ -35,7 +35,7 @@ type CompareFn<'a, 'gc> = Box<
|
||||||
|
|
||||||
pub fn create_array_object<'gc>(
|
pub fn create_array_object<'gc>(
|
||||||
gc_context: MutationContext<'gc, '_>,
|
gc_context: MutationContext<'gc, '_>,
|
||||||
array_proto: Option<Object<'gc>>,
|
array_proto: Object<'gc>,
|
||||||
fn_proto: Option<Object<'gc>>,
|
fn_proto: Option<Object<'gc>>,
|
||||||
) -> Object<'gc> {
|
) -> Object<'gc> {
|
||||||
let array = FunctionObject::function_and_constructor(
|
let array = FunctionObject::function_and_constructor(
|
||||||
|
|
|
@ -50,7 +50,7 @@ pub fn boolean_function<'gc>(
|
||||||
|
|
||||||
pub fn create_boolean_object<'gc>(
|
pub fn create_boolean_object<'gc>(
|
||||||
gc_context: MutationContext<'gc, '_>,
|
gc_context: MutationContext<'gc, '_>,
|
||||||
boolean_proto: Option<Object<'gc>>,
|
boolean_proto: Object<'gc>,
|
||||||
fn_proto: Option<Object<'gc>>,
|
fn_proto: Option<Object<'gc>>,
|
||||||
) -> Object<'gc> {
|
) -> Object<'gc> {
|
||||||
FunctionObject::function_and_constructor(
|
FunctionObject::function_and_constructor(
|
||||||
|
|
|
@ -50,7 +50,7 @@ pub fn number_function<'gc>(
|
||||||
|
|
||||||
pub fn create_number_object<'gc>(
|
pub fn create_number_object<'gc>(
|
||||||
gc_context: MutationContext<'gc, '_>,
|
gc_context: MutationContext<'gc, '_>,
|
||||||
number_proto: Option<Object<'gc>>,
|
number_proto: Object<'gc>,
|
||||||
fn_proto: Option<Object<'gc>>,
|
fn_proto: Option<Object<'gc>>,
|
||||||
) -> Object<'gc> {
|
) -> Object<'gc> {
|
||||||
let number = FunctionObject::function_and_constructor(
|
let number = FunctionObject::function_and_constructor(
|
||||||
|
|
|
@ -51,7 +51,7 @@ pub fn string_function<'gc>(
|
||||||
|
|
||||||
pub fn create_string_object<'gc>(
|
pub fn create_string_object<'gc>(
|
||||||
gc_context: MutationContext<'gc, '_>,
|
gc_context: MutationContext<'gc, '_>,
|
||||||
string_proto: Option<Object<'gc>>,
|
string_proto: Object<'gc>,
|
||||||
fn_proto: Option<Object<'gc>>,
|
fn_proto: Option<Object<'gc>>,
|
||||||
) -> Object<'gc> {
|
) -> Object<'gc> {
|
||||||
let string = FunctionObject::function_and_constructor(
|
let string = FunctionObject::function_and_constructor(
|
||||||
|
|
Loading…
Reference in New Issue