Add tests for `valueOf`.
This commit is contained in:
parent
b4d907bf2e
commit
03a240ebcd
|
@ -252,6 +252,9 @@ swf_tests! {
|
|||
(as3_object_to_locale_string, "avm2/object_to_locale_string", 1),
|
||||
(as3_function_to_locale_string, "avm2/function_to_locale_string", 1),
|
||||
(as3_class_to_locale_string, "avm2/class_to_locale_string", 1),
|
||||
(as3_object_value_of, "avm2/object_value_of", 1),
|
||||
(as3_function_value_of, "avm2/function_value_of", 1),
|
||||
(as3_class_value_of, "avm2/class_value_of", 1),
|
||||
}
|
||||
|
||||
// TODO: These tests have some inaccuracies currently, so we use approx_eq to test that numeric values are close enough.
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
package {
|
||||
public class Test {}
|
||||
}
|
||||
|
||||
class ES4Class {
|
||||
|
||||
}
|
||||
|
||||
trace("//ES4Class.valueOf() === ES4Class");
|
||||
trace(ES4Class.valueOf() === ES4Class);
|
|
@ -0,0 +1,2 @@
|
|||
//ES4Class.valueOf() === ES4Class
|
||||
true
|
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,16 @@
|
|||
package {
|
||||
public class Test {}
|
||||
}
|
||||
|
||||
var freeFunction = function() {
|
||||
};
|
||||
|
||||
function namedFunction() {
|
||||
|
||||
}
|
||||
|
||||
trace("//freeFunction.valueOf() === freeFunction");
|
||||
trace(freeFunction.valueOf() === freeFunction);
|
||||
|
||||
trace("//namedFunction.valueOf() === namedFunction");
|
||||
trace(namedFunction.valueOf() === namedFunction);
|
|
@ -0,0 +1,4 @@
|
|||
//freeFunction.valueOf() === freeFunction
|
||||
true
|
||||
//namedFunction.valueOf() === namedFunction
|
||||
true
|
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,8 @@
|
|||
package {
|
||||
public class Test {}
|
||||
}
|
||||
|
||||
var obj = new Object();
|
||||
|
||||
trace("//obj.valueOf() === obj");
|
||||
trace(obj.valueOf() === obj);
|
|
@ -0,0 +1,2 @@
|
|||
//obj.valueOf() === obj
|
||||
true
|
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue