tests: Port avmplus ecma3 Expression tests

This commit is contained in:
Nathan Adams 2023-07-28 00:15:08 +02:00
parent 8ff5ff8176
commit 1a354d5809
380 changed files with 17486 additions and 0 deletions

View File

@ -0,0 +1,71 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
package {
import flash.display.MovieClip; public class Test extends MovieClip {}
}
import com.adobe.test.Assert;
// var SECTION = "StrictEquality_001 - 11.9.6";
// var VERSION = "ECMA_2";
// var TITLE = "The strict equality operator ( === )";
var testcases = getTestCases();
function getTestCases() {
var array = new Array();
var item = 0;
// 1. If Type(x) is different from Type(y) return false
// see bug 103471 for details
StrictEquality( true, new Boolean(true), true, array, item++);
StrictEquality( new Boolean(), false, true, array, item++);
StrictEquality( "", new String(), true, array, item++);
StrictEquality( new String("hi"), "hi", true, array, item++);
// 2. If Type(x) is not Number go to step 9.
// 3. If x is NaN, return false
StrictEquality( NaN, NaN, false, array, item++ );
StrictEquality( NaN, 0, false, array, item++ );
// 4. If y is NaN, return false.
StrictEquality( 0, NaN, false, array, item++ );
// 5. if x is the same number value as y, return true
// 6. If x is +0 and y is -0, return true
// 7. If x is -0 and y is +0, return true
// 8. Return false.
// 9. If Type(x) is String, then return true if x and y are exactly
// the same sequence of characters ( same length and same characters
// in corresponding positions.) Otherwise return false.
// 10. If Type(x) is Boolean, return true if x and y are both true or
// both false. otherwise return false.
// Return true if x and y refer to the same object. Otherwise return
// false.
// Return false.
return array;
}
function StrictEquality( x, y, expect, array, item ) {
result = ( x === y );
array[item] = Assert.expectEq(
x +" === " + y,
expect,
result );
}

View File

@ -0,0 +1,13 @@
<flex-config>
<compiler>
<source-path>
<path-element>.</path-element>
<path-element>../../../lib</path-element>
</source-path>
<debug>false</debug>
<omit-trace-statements>false</omit-trace-statements>
<show-actionscript-warnings>false</show-actionscript-warnings>
<strict>false</strict>
</compiler>
<output>test.swf</output>
</flex-config>

View File

@ -0,0 +1,7 @@
true === true PASSED!
false === false PASSED!
=== PASSED!
hi === hi PASSED!
NaN === NaN PASSED!
NaN === 0 PASSED!
0 === NaN PASSED!

View File

@ -0,0 +1 @@
num_ticks = 1

View File

@ -0,0 +1,223 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
package {
import flash.display.MovieClip; public class Test extends MovieClip {}
}
import com.adobe.test.Assert;
// var SECTION = "e11_10_1";
// var VERSION = "ECMA_1";
var testcases = getTestCases();
function getTestCases() {
var array = new Array();
var item = 0;
var shiftexp = 0;
var addexp = 0;
// for ( shiftpow = 0; shiftpow < 33; shiftpow++ ) {
for ( shiftpow = 0; shiftpow < 1; shiftpow++ ) {
shiftexp += Math.pow( 2, shiftpow );
// changing from 31 to 33... ecma3 only requires that we
// support up to the max signed 32-bit int... this was
// testing the max unsigned 32-bit int which we will not
// support
for ( addpow = 0; addpow < 31; addpow++ ) {
addexp += Math.pow(2, addpow);
array[item++] = Assert.expectEq(
shiftexp + " & " + addexp,
And( shiftexp, addexp ),
shiftexp & addexp );
}
}
return ( array );
}
function ToInteger( n ) {
n = Number( n );
var sign = ( n < 0 ) ? -1 : 1;
if ( n != n ) {
return 0;
}
if ( Math.abs( n ) == 0 || Math.abs( n ) == Number.POSITIVE_INFINITY ) {
return n;
}
return ( sign * Math.floor(Math.abs(n)) );
}
function ToInt32( n ) {
n = Number( n );
var sign = ( n < 0 ) ? -1 : 1;
if ( Math.abs( n ) == 0 || Math.abs( n ) == Number.POSITIVE_INFINITY) {
return 0;
}
n = (sign * Math.floor( Math.abs(n) )) % Math.pow(2,32);
n = ( n >= Math.pow(2,31) ) ? n - Math.pow(2,32) : n;
return ( n );
}
function ToUint32( n ) {
n = Number( n );
var sign = ( n < 0 ) ? -1 : 1;
if ( Math.abs( n ) == 0 || Math.abs( n ) == Number.POSITIVE_INFINITY) {
return 0;
}
n = sign * Math.floor( Math.abs(n) )
n = n % Math.pow(2,32);
if ( n < 0 ){
n += Math.pow(2,32);
}
return ( n );
}
function ToUint16( n ) {
var sign = ( n < 0 ) ? -1 : 1;
if ( Math.abs( n ) == 0 || Math.abs( n ) == Number.POSITIVE_INFINITY) {
return 0;
}
n = ( sign * Math.floor( Math.abs(n) ) ) % Math.pow(2,16);
if (n <0) {
n += Math.pow(2,16);
}
return ( n );
}
function Mask( b, n ) {
b = ToUint32BitString( b );
b = b.substring( b.length - n );
b = ToUint32Decimal( b );
return ( b );
}
function ToUint32BitString( n ) {
var b = "";
for ( p = 31; p >=0; p-- ) {
if ( n >= Math.pow(2,p) ) {
b += "1";
n -= Math.pow(2,p);
} else {
b += "0";
}
}
return b;
}
function ToInt32BitString( n ) {
var b = "";
var sign = ( n < 0 ) ? -1 : 1;
b += ( sign == 1 ) ? "0" : "1";
for ( p = 30; p >=0; p-- ) {
if ( (sign == 1 ) ? sign * n >= Math.pow(2,p) : sign * n > Math.pow(2,p) ) {
b += ( sign == 1 ) ? "1" : "0";
n -= sign * Math.pow( 2, p );
} else {
b += ( sign == 1 ) ? "0" : "1";
}
}
return b;
}
function ToInt32Decimal( bin ) {
var r = 0;
var sign;
if ( Number(bin.charAt(0)) == 0 ) {
sign = 1;
r = 0;
} else {
sign = -1;
r = -(Math.pow(2,31));
}
for ( var j = 0; j < 31; j++ ) {
r += Math.pow( 2, j ) * Number(bin.charAt(31-j));
}
return r;
}
function ToUint32Decimal( bin ) {
var r = 0;
for ( l = bin.length; l < 32; l++ ) {
bin = "0" + bin;
}
for ( j = 0; j < 31; j++ ) {
r += Math.pow( 2, j ) * Number(bin.charAt(31-j));
}
return r;
}
function And( s, a ) {
s = ToInt32( s );
a = ToInt32( a );
var bs = ToInt32BitString( s );
var ba = ToInt32BitString( a );
var result = "";
for ( var bit = 0; bit < bs.length; bit++ ) {
if ( bs.charAt(bit) == "1" && ba.charAt(bit) == "1" ) {
result += "1";
} else {
result += "0";
}
}
return ToInt32Decimal(result);
}
function Xor( s, a ) {
s = ToInt32( s );
a = ToInt32( a );
var bs = ToInt32BitString( s );
var ba = ToInt32BitString( a );
var result = "";
for ( var bit = 0; bit < bs.length; bit++ ) {
if ( (bs.charAt(bit) == "1" && ba.charAt(bit) == "0") ||
(bs.charAt(bit) == "0" && ba.charAt(bit) == "1")
) {
result += "1";
} else {
result += "0";
}
}
return ToInt32Decimal(result);
}
function Or( s, a ) {
s = ToInt32( s );
a = ToInt32( a );
var bs = ToInt32BitString( s );
var ba = ToInt32BitString( a );
var result = "";
for ( var bit = 0; bit < bs.length; bit++ ) {
if ( bs.charAt(bit) == "1" || ba.charAt(bit) == "1" ) {
result += "1";
} else {
result += "0";
}
}
return ToInt32Decimal(result);
}

View File

@ -0,0 +1,13 @@
<flex-config>
<compiler>
<source-path>
<path-element>.</path-element>
<path-element>../../../lib</path-element>
</source-path>
<debug>false</debug>
<omit-trace-statements>false</omit-trace-statements>
<show-actionscript-warnings>false</show-actionscript-warnings>
<strict>false</strict>
</compiler>
<output>test.swf</output>
</flex-config>

View File

@ -0,0 +1,31 @@
1 & 1 PASSED!
1 & 3 PASSED!
1 & 7 PASSED!
1 & 15 PASSED!
1 & 31 PASSED!
1 & 63 PASSED!
1 & 127 PASSED!
1 & 255 PASSED!
1 & 511 PASSED!
1 & 1023 PASSED!
1 & 2047 PASSED!
1 & 4095 PASSED!
1 & 8191 PASSED!
1 & 16383 PASSED!
1 & 32767 PASSED!
1 & 65535 PASSED!
1 & 131071 PASSED!
1 & 262143 PASSED!
1 & 524287 PASSED!
1 & 1048575 PASSED!
1 & 2097151 PASSED!
1 & 4194303 PASSED!
1 & 8388607 PASSED!
1 & 16777215 PASSED!
1 & 33554431 PASSED!
1 & 67108863 PASSED!
1 & 134217727 PASSED!
1 & 268435455 PASSED!
1 & 536870911 PASSED!
1 & 1073741823 PASSED!
1 & 2147483647 PASSED!

View File

@ -0,0 +1 @@
num_ticks = 1

View File

@ -0,0 +1,218 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
package {
import flash.display.MovieClip; public class Test extends MovieClip {}
}
import com.adobe.test.Assert;
// var SECTION = "e11_10_2";
// var VERSION = "ECMA_1";
var testcases = getTestCases();
function getTestCases() {
var array = new Array();
var item = 0;
var shiftexp = 0;
var addexp = 0;
for ( shiftpow = 0; shiftpow < 33; shiftpow++ ) {
shiftexp += Math.pow( 2, shiftpow );
for ( addpow = 0; addpow < 33; addpow++ ) {
addexp += Math.pow(2, addpow);
array[item++] = Assert.expectEq(
shiftexp + " | " + addexp,
Or( shiftexp, addexp ),
shiftexp | addexp );
}
}
return ( array );
}
function ToInteger( n ) {
n = Number( n );
var sign = ( n < 0 ) ? -1 : 1;
if ( n != n ) {
return 0;
}
if ( Math.abs( n ) == 0 || Math.abs( n ) == Number.POSITIVE_INFINITY ) {
return n;
}
return ( sign * Math.floor(Math.abs(n)) );
}
function ToInt32( n ) {
n = Number( n );
var sign = ( n < 0 ) ? -1 : 1;
if ( Math.abs( n ) == 0 || Math.abs( n ) == Number.POSITIVE_INFINITY) {
return 0;
}
n = (sign * Math.floor( Math.abs(n) )) % Math.pow(2,32);
n = ( n >= Math.pow(2,31) ) ? n - Math.pow(2,32) : n;
return ( n );
}
function ToUint32( n ) {
n = Number( n );
var sign = ( n < 0 ) ? -1 : 1;
if ( Math.abs( n ) == 0 || Math.abs( n ) == Number.POSITIVE_INFINITY) {
return 0;
}
n = sign * Math.floor( Math.abs(n) )
n = n % Math.pow(2,32);
if ( n < 0 ){
n += Math.pow(2,32);
}
return ( n );
}
function ToUint16( n ) {
var sign = ( n < 0 ) ? -1 : 1;
if ( Math.abs( n ) == 0 || Math.abs( n ) == Number.POSITIVE_INFINITY) {
return 0;
}
n = ( sign * Math.floor( Math.abs(n) ) ) % Math.pow(2,16);
if (n <0) {
n += Math.pow(2,16);
}
return ( n );
}
function Mask( b, n ) {
b = ToUint32BitString( b );
b = b.substring( b.length - n );
b = ToUint32Decimal( b );
return ( b );
}
function ToUint32BitString( n ) {
var b = "";
for ( p = 31; p >=0; p-- ) {
if ( n >= Math.pow(2,p) ) {
b += "1";
n -= Math.pow(2,p);
} else {
b += "0";
}
}
return b;
}
function ToInt32BitString( n ) {
var b = "";
var sign = ( n < 0 ) ? -1 : 1;
b += ( sign == 1 ) ? "0" : "1";
for ( p = 30; p >=0; p-- ) {
if ( (sign == 1 ) ? sign * n >= Math.pow(2,p) : sign * n > Math.pow(2,p) ) {
b += ( sign == 1 ) ? "1" : "0";
n -= sign * Math.pow( 2, p );
} else {
b += ( sign == 1 ) ? "0" : "1";
}
}
return b;
}
function ToInt32Decimal( bin ) {
var r = 0;
var sign;
if ( Number(bin.charAt(0)) == 0 ) {
sign = 1;
r = 0;
} else {
sign = -1;
r = -(Math.pow(2,31));
}
for ( var j = 0; j < 31; j++ ) {
r += Math.pow( 2, j ) * Number(bin.charAt(31-j));
}
return r;
}
function ToUint32Decimal( bin ) {
var r = 0;
for ( l = bin.length; l < 32; l++ ) {
bin = "0" + bin;
}
for ( j = 0; j < 31; j++ ) {
r += Math.pow( 2, j ) * Number(bin.charAt(31-j));
}
return r;
}
function And( s, a ) {
s = ToInt32( s );
a = ToInt32( a );
var bs = ToInt32BitString( s );
var ba = ToInt32BitString( a );
var result = "";
for ( var bit = 0; bit < bs.length; bit++ ) {
if ( bs.charAt(bit) == "1" && ba.charAt(bit) == "1" ) {
result += "1";
} else {
result += "0";
}
}
return ToInt32Decimal(result);
}
function Xor( s, a ) {
s = ToInt32( s );
a = ToInt32( a );
var bs = ToInt32BitString( s );
var ba = ToInt32BitString( a );
var result = "";
for ( var bit = 0; bit < bs.length; bit++ ) {
if ( (bs.charAt(bit) == "1" && ba.charAt(bit) == "0") ||
(bs.charAt(bit) == "0" && ba.charAt(bit) == "1")
) {
result += "1";
} else {
result += "0";
}
}
return ToInt32Decimal(result);
}
function Or( s, a ) {
s = ToInt32( s );
a = ToInt32( a );
var bs = ToInt32BitString( s );
var ba = ToInt32BitString( a );
var result = "";
for ( var bit = 0; bit < bs.length; bit++ ) {
if ( bs.charAt(bit) == "1" || ba.charAt(bit) == "1" ) {
result += "1";
} else {
result += "0";
}
}
return ToInt32Decimal(result);
}

View File

@ -0,0 +1,13 @@
<flex-config>
<compiler>
<source-path>
<path-element>.</path-element>
<path-element>../../../lib</path-element>
</source-path>
<debug>false</debug>
<omit-trace-statements>false</omit-trace-statements>
<show-actionscript-warnings>false</show-actionscript-warnings>
<strict>false</strict>
</compiler>
<output>test.swf</output>
</flex-config>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1 @@
num_ticks = 1

View File

@ -0,0 +1,217 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
package {
import flash.display.MovieClip; public class Test extends MovieClip {}
}
import com.adobe.test.Assert;
// var SECTION = "e11_10_3";
// var VERSION = "ECMA_1";
var testcases = getTestCases();
function getTestCases() {
var array = new Array();
var item = 0;
var shiftexp = 0;
var addexp = 0;
for ( shiftpow = 0; shiftpow < 33; shiftpow++ ) {
shiftexp += Math.pow( 2, shiftpow );
for ( addpow = 0; addpow < 33; addpow++ ) {
addexp += Math.pow(2, addpow);
array[item++] = Assert.expectEq(
shiftexp + " ^ " + addexp,
Xor( shiftexp, addexp ),
shiftexp ^ addexp );
}
}
return ( array );
}
function ToInteger( n ) {
n = Number( n );
var sign = ( n < 0 ) ? -1 : 1;
if ( n != n ) {
return 0;
}
if ( Math.abs( n ) == 0 || Math.abs( n ) == Number.POSITIVE_INFINITY ) {
return n;
}
return ( sign * Math.floor(Math.abs(n)) );
}
function ToInt32( n ) {
n = Number( n );
var sign = ( n < 0 ) ? -1 : 1;
if ( Math.abs( n ) == 0 || Math.abs( n ) == Number.POSITIVE_INFINITY) {
return 0;
}
n = (sign * Math.floor( Math.abs(n) )) % Math.pow(2,32);
n = ( n >= Math.pow(2,31) ) ? n - Math.pow(2,32) : n;
return ( n );
}
function ToUint32( n ) {
n = Number( n );
var sign = ( n < 0 ) ? -1 : 1;
if ( Math.abs( n ) == 0 || Math.abs( n ) == Number.POSITIVE_INFINITY) {
return 0;
}
n = sign * Math.floor( Math.abs(n) )
n = n % Math.pow(2,32);
if ( n < 0 ){
n += Math.pow(2,32);
}
return ( n );
}
function ToUint16( n ) {
var sign = ( n < 0 ) ? -1 : 1;
if ( Math.abs( n ) == 0 || Math.abs( n ) == Number.POSITIVE_INFINITY) {
return 0;
}
n = ( sign * Math.floor( Math.abs(n) ) ) % Math.pow(2,16);
if (n <0) {
n += Math.pow(2,16);
}
return ( n );
}
function Mask( b, n ) {
b = ToUint32BitString( b );
b = b.substring( b.length - n );
b = ToUint32Decimal( b );
return ( b );
}
function ToUint32BitString( n ) {
var b = "";
for ( p = 31; p >=0; p-- ) {
if ( n >= Math.pow(2,p) ) {
b += "1";
n -= Math.pow(2,p);
} else {
b += "0";
}
}
return b;
}
function ToInt32BitString( n ) {
var b = "";
var sign = ( n < 0 ) ? -1 : 1;
b += ( sign == 1 ) ? "0" : "1";
for ( p = 30; p >=0; p-- ) {
if ( (sign == 1 ) ? sign * n >= Math.pow(2,p) : sign * n > Math.pow(2,p) ) {
b += ( sign == 1 ) ? "1" : "0";
n -= sign * Math.pow( 2, p );
} else {
b += ( sign == 1 ) ? "0" : "1";
}
}
return b;
}
function ToInt32Decimal( bin ) {
var r = 0;
var sign;
if ( Number(bin.charAt(0)) == 0 ) {
sign = 1;
r = 0;
} else {
sign = -1;
r = -(Math.pow(2,31));
}
for ( var j = 0; j < 31; j++ ) {
r += Math.pow( 2, j ) * Number(bin.charAt(31-j));
}
return r;
}
function ToUint32Decimal( bin ) {
var r = 0;
for ( l = bin.length; l < 32; l++ ) {
bin = "0" + bin;
}
for ( j = 0; j < 31; j++ ) {
r += Math.pow( 2, j ) * Number(bin.charAt(31-j));
}
return r;
}
function And( s, a ) {
s = ToInt32( s );
a = ToInt32( a );
var bs = ToInt32BitString( s );
var ba = ToInt32BitString( a );
var result = "";
for ( var bit = 0; bit < bs.length; bit++ ) {
if ( bs.charAt(bit) == "1" && ba.charAt(bit) == "1" ) {
result += "1";
} else {
result += "0";
}
}
return ToInt32Decimal(result);
}
function Xor( s, a ) {
s = ToInt32( s );
a = ToInt32( a );
var bs = ToInt32BitString( s );
var ba = ToInt32BitString( a );
var result = "";
for ( var bit = 0; bit < bs.length; bit++ ) {
if ( (bs.charAt(bit) == "1" && ba.charAt(bit) == "0") ||
(bs.charAt(bit) == "0" && ba.charAt(bit) == "1")
) {
result += "1";
} else {
result += "0";
}
}
return ToInt32Decimal(result);
}
function Or( s, a ) {
s = ToInt32( s );
a = ToInt32( a );
var bs = ToInt32BitString( s );
var ba = ToInt32BitString( a );
var result = "";
for ( var bit = 0; bit < bs.length; bit++ ) {
if ( bs.charAt(bit) == "1" || ba.charAt(bit) == "1" ) {
result += "1";
} else {
result += "0";
}
}
return ToInt32Decimal(result);
}

View File

@ -0,0 +1,13 @@
<flex-config>
<compiler>
<source-path>
<path-element>.</path-element>
<path-element>../../../lib</path-element>
</source-path>
<debug>false</debug>
<omit-trace-statements>false</omit-trace-statements>
<show-actionscript-warnings>false</show-actionscript-warnings>
<strict>false</strict>
</compiler>
<output>test.swf</output>
</flex-config>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1 @@
num_ticks = 1

View File

@ -0,0 +1,84 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
package {
import flash.display.MovieClip; public class Test extends MovieClip {}
}
import com.adobe.test.Assert;
// var SECTION = "11.11";
// var VERSION = "ECMA_1";
var BUGNUMBER="771111";
var testcases = getTestCases();
function getTestCases() {
var array = new Array();
var item = 0;
array[item++] = Assert.expectEq( "void 0 && void 0", undefined, void 0 && void 0 );
array[item++] = Assert.expectEq( "null && null", null, null && null );
array[item++] = Assert.expectEq( "0 && 0", 0, 0 && 0 );
array[item++] = Assert.expectEq( "1 && 1", 1, 1 && 1 );
array[item++] = Assert.expectEq( "-1 && -1", -1, -1 && -1 );
array[item++] = Assert.expectEq( "54 && 54", 54, 54 && 54 );
array[item++] = Assert.expectEq( "54 && 45", 45, 54 && 45 );
array[item++] = Assert.expectEq( "true && true", true, true && true );
array[item++] = Assert.expectEq( "true && false", false, true && false );
array[item++] = Assert.expectEq( "false && true", false, false && true );
array[item++] = Assert.expectEq( "false && false", false, false && false );
array[item++] = Assert.expectEq( "0 && true", 0, 0 && true );
array[item++] = Assert.expectEq( "true && 0", 0, true && 0 );
array[item++] = Assert.expectEq( "true && 1", 1, true && 1 );
array[item++] = Assert.expectEq( "1 && true", true, 1 && true );
array[item++] = Assert.expectEq( "-1 && true", true, -1 && true );
array[item++] = Assert.expectEq( "true && -1", -1, true && -1 );
array[item++] = Assert.expectEq( "true && 9", 9, true && 9 );
array[item++] = Assert.expectEq( "true && -9", -9, true && -9 );
array[item++] = Assert.expectEq( "9 && true", true, 9 && true );
array[item++] = Assert.expectEq( "true && Number.POSITIVE_INFINITY", Number.POSITIVE_INFINITY, true && Number.POSITIVE_INFINITY );
array[item++] = Assert.expectEq( "Number.NEGATIVE_INFINITY && true", true, Number.NEGATIVE_INFINITY && true );
array[item++] = Assert.expectEq( "true && 'str'", "str", true && "str" );
array[item++] = Assert.expectEq( "'str' && true", true, "str" && true);
array[item++] = Assert.expectEq( "false && 'str'", false, false && "str" );
array[item++] = Assert.expectEq( "'str' && false", false, "str" && false);
array[item++] = Assert.expectEq( "NaN && NaN", NaN, Number.NaN && Number.NaN );
array[item++] = Assert.expectEq( "NaN && 0", NaN, Number.NaN && 0 );
array[item++] = Assert.expectEq( "0 && NaN", 0, 0 && Number.NaN );
array[item++] = Assert.expectEq( "NaN && Infinity", NaN, Number.NaN && Number.POSITIVE_INFINITY );
array[item++] = Assert.expectEq( "Infinity && NaN", NaN, Number.POSITIVE_INFINITY && Number.NaN );
array[item++] = Assert.expectEq( "void 0 || void 0", undefined, void 0 || void 0 );
array[item++] = Assert.expectEq( "null || null", null, null || null );
array[item++] = Assert.expectEq( "0 || 0", 0, 0 || 0 );
array[item++] = Assert.expectEq( "1 || 1", 1, 1 || 1 );
array[item++] = Assert.expectEq( "-1 || -1", -1, -1 || -1 );
array[item++] = Assert.expectEq( "54 || 54", 54, 54 || 54 );
array[item++] = Assert.expectEq( "54 || 45", 54, 54 || 45 );
array[item++] = Assert.expectEq( "true || true", true, true || true );
array[item++] = Assert.expectEq( "true || false", true, true || false );
array[item++] = Assert.expectEq( "false || true", true, false || true );
array[item++] = Assert.expectEq( "false || false", false, false ||false );
array[item++] = Assert.expectEq( "0 || true", true, 0 || true );
array[item++] = Assert.expectEq( "true || 0", true, true || 0 );
array[item++] = Assert.expectEq( "true || 1", true, true || 1 );
array[item++] = Assert.expectEq( "1 || true", 1, 1 || true );
array[item++] = Assert.expectEq( "-1 || true", -1, -1 || true );
array[item++] = Assert.expectEq( "true || -1", true, true || -1 );
array[item++] = Assert.expectEq( "true || 9", true, true || 9 );
array[item++] = Assert.expectEq( "true || -9", true, true || -9 );
array[item++] = Assert.expectEq( "9 || true", 9, 9 || true );
array[item++] = Assert.expectEq( "true || Number.POSITIVE_INFINITY", true, true || Number.POSITIVE_INFINITY );
array[item++] = Assert.expectEq( "Number.NEGATIVE_INFINITY || true", Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINITY ||true );
array[item++] = Assert.expectEq( "true || 'str'", true, true || "str" );
array[item++] = Assert.expectEq( "'str'|| true", "str", "str" || true);
array[item++] = Assert.expectEq( "false || 'str'", "str", false ||"str" );
array[item++] = Assert.expectEq( "'str' || false", "str", "str" || false);
array[item++] = Assert.expectEq( "NaN || NaN", NaN, Number.NaN || Number.NaN );
array[item++] = Assert.expectEq( "NaN || 0", 0, Number.NaN || 0 );
array[item++] = Assert.expectEq( "0 || NaN", NaN, 0 || Number.NaN );
array[item++] = Assert.expectEq( "NaN || Infinity", Infinity, Number.NaN ||Number.POSITIVE_INFINITY );
array[item++] = Assert.expectEq( "Infinity || NaN", Infinity, Number.POSITIVE_INFINITY || Number.NaN );
return ( array );
}

View File

@ -0,0 +1,13 @@
<flex-config>
<compiler>
<source-path>
<path-element>.</path-element>
<path-element>../../../lib</path-element>
</source-path>
<debug>false</debug>
<omit-trace-statements>false</omit-trace-statements>
<show-actionscript-warnings>false</show-actionscript-warnings>
<strict>false</strict>
</compiler>
<output>test.swf</output>
</flex-config>

View File

@ -0,0 +1,62 @@
void 0 && void 0 PASSED!
null && null PASSED!
0 && 0 PASSED!
1 && 1 PASSED!
-1 && -1 PASSED!
54 && 54 PASSED!
54 && 45 PASSED!
true && true PASSED!
true && false PASSED!
false && true PASSED!
false && false PASSED!
0 && true PASSED!
true && 0 PASSED!
true && 1 PASSED!
1 && true PASSED!
-1 && true PASSED!
true && -1 PASSED!
true && 9 PASSED!
true && -9 PASSED!
9 && true PASSED!
true && Number.POSITIVE_INFINITY PASSED!
Number.NEGATIVE_INFINITY && true PASSED!
true && 'str' PASSED!
'str' && true PASSED!
false && 'str' PASSED!
'str' && false PASSED!
NaN && NaN PASSED!
NaN && 0 PASSED!
0 && NaN PASSED!
NaN && Infinity PASSED!
Infinity && NaN PASSED!
void 0 || void 0 PASSED!
null || null PASSED!
0 || 0 PASSED!
1 || 1 PASSED!
-1 || -1 PASSED!
54 || 54 PASSED!
54 || 45 PASSED!
true || true PASSED!
true || false PASSED!
false || true PASSED!
false || false PASSED!
0 || true PASSED!
true || 0 PASSED!
true || 1 PASSED!
1 || true PASSED!
-1 || true PASSED!
true || -1 PASSED!
true || 9 PASSED!
true || -9 PASSED!
9 || true PASSED!
true || Number.POSITIVE_INFINITY PASSED!
Number.NEGATIVE_INFINITY || true PASSED!
true || 'str' PASSED!
'str'|| true PASSED!
false || 'str' PASSED!
'str' || false PASSED!
NaN || NaN PASSED!
NaN || 0 PASSED!
0 || NaN PASSED!
NaN || Infinity PASSED!
Infinity || NaN PASSED!

View File

@ -0,0 +1 @@
num_ticks = 1

View File

@ -0,0 +1,29 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
package {
import flash.display.MovieClip; public class Test extends MovieClip {}
}
import com.adobe.test.Assert;
// var SECTION = "e11_12";
// var VERSION = "ECMA_1";
var testcases = getTestCases();
function getTestCases() {
var array = new Array();
var item = 0;
array[item++] = Assert.expectEq( "true ? 'PASSED' : 'FAILED'", "PASSED", (true?"PASSED":"FAILED"));
array[item++] = Assert.expectEq( "false ? 'FAILED' : 'PASSED'", "PASSED", (false?"FAILED":"PASSED"));
array[item++] = Assert.expectEq( "1 ? 'PASSED' : 'FAILED'", "PASSED", (1?"PASSED":"FAILED"));
array[item++] = Assert.expectEq( "0 ? 'FAILED' : 'PASSED'", "PASSED", (0?"FAILED":"PASSED"));
array[item++] = Assert.expectEq( "-1 ? 'PASSED' : 'FAILED'", "PASSED", (-1?"PASSED":"FAILED"));
array[item++] = Assert.expectEq( "NaN ? 'FAILED' : 'PASSED'", "PASSED", (Number.NaN?"FAILED":"PASSED"));
array[item++] = Assert.expectEq( "var VAR = true ? , : 'FAILED'", "PASSED", (VAR = true ? "PASSED" : "FAILED") );
return ( array );
}

View File

@ -0,0 +1,13 @@
<flex-config>
<compiler>
<source-path>
<path-element>.</path-element>
<path-element>../../../lib</path-element>
</source-path>
<debug>false</debug>
<omit-trace-statements>false</omit-trace-statements>
<show-actionscript-warnings>false</show-actionscript-warnings>
<strict>false</strict>
</compiler>
<output>test.swf</output>
</flex-config>

View File

@ -0,0 +1,7 @@
true ? 'PASSED' : 'FAILED' PASSED!
false ? 'FAILED' : 'PASSED' PASSED!
1 ? 'PASSED' : 'FAILED' PASSED!
0 ? 'FAILED' : 'PASSED' PASSED!
-1 ? 'PASSED' : 'FAILED' PASSED!
NaN ? 'FAILED' : 'PASSED' PASSED!
var VAR = true ? , : 'FAILED' PASSED!

View File

@ -0,0 +1 @@
num_ticks = 1

View File

@ -0,0 +1,30 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
package {
import flash.display.MovieClip; public class Test extends MovieClip {}
}
import com.adobe.test.Assert;
// var SECTION = "11_12_3";
// var VERSION = "ECMA_1";
var testcases = getTestCases();
function getTestCases() {
var array = new Array();
var item = 0;
// the following expression should NOT be an error in JS.
var MYVAR = true ? ('FAIL1', 'PASSED') : 'FAIL2';
array[item++] = Assert.expectEq(
"var MYVAR = true ? ('FAIL1', 'PASSED') : 'FAIL2'; MYVAR",
"PASSED",
MYVAR );
// get around potential parse time error by putting expression in an eval statement
//array[tc].actual = array[tc].actual;
return (array);
}

View File

@ -0,0 +1,13 @@
<flex-config>
<compiler>
<source-path>
<path-element>.</path-element>
<path-element>../../../lib</path-element>
</source-path>
<debug>false</debug>
<omit-trace-statements>false</omit-trace-statements>
<show-actionscript-warnings>false</show-actionscript-warnings>
<strict>false</strict>
</compiler>
<output>test.swf</output>
</flex-config>

View File

@ -0,0 +1 @@
var MYVAR = true ? ('FAIL1', 'PASSED') : 'FAIL2'; MYVAR PASSED!

View File

@ -0,0 +1 @@
num_ticks = 1

View File

@ -0,0 +1,30 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
package {
import flash.display.MovieClip; public class Test extends MovieClip {}
}
import com.adobe.test.Assert;
// var SECTION = "11_12_4";
// var VERSION = "ECMA_1";
var testcases = getTestCases();
function getTestCases() {
var array = new Array();
var item = 0;
// the following expression should NOT be an error in JS.
true ? MYVAR1 = 'PASSED' : MYVAR1 = 'FAILED'
array[item++] = Assert.expectEq(
"true ? MYVAR1 = 'PASSED' : MYVAR1 = 'FAILED'; MYVAR1",
"PASSED",
MYVAR1);
// get around potential parse time error by putting expression in an eval statement
//array[tc].actual = ( array[tc].actual );
return (array);
}

View File

@ -0,0 +1,13 @@
<flex-config>
<compiler>
<source-path>
<path-element>.</path-element>
<path-element>../../../lib</path-element>
</source-path>
<debug>false</debug>
<omit-trace-statements>false</omit-trace-statements>
<show-actionscript-warnings>false</show-actionscript-warnings>
<strict>false</strict>
</compiler>
<output>test.swf</output>
</flex-config>

View File

@ -0,0 +1 @@
true ? MYVAR1 = 'PASSED' : MYVAR1 = 'FAILED'; MYVAR1 PASSED!

View File

@ -0,0 +1 @@
num_ticks = 1

View File

@ -0,0 +1,29 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
package {
import flash.display.MovieClip; public class Test extends MovieClip {}
}
import com.adobe.test.Assert;
// var SECTION = "11_12";
// var VERSION = "ECMA_1";
var testcases = getTestCases();
function getTestCases() {
var array = new Array();
var item = 0;
array[item++] = Assert.expectEq( "true ? 'PASSED' : 'FAILED'", "PASSED", (true?"PASSED":"FAILED"));
array[item++] = Assert.expectEq( "false ? 'FAILED' : 'PASSED'", "PASSED", (false?"FAILED":"PASSED"));
array[item++] = Assert.expectEq( "1 ? 'PASSED' : 'FAILED'", "PASSED", (1?"PASSED":"FAILED"));
array[item++] = Assert.expectEq( "0 ? 'FAILED' : 'PASSED'", "PASSED", (0?"FAILED":"PASSED"));
array[item++] = Assert.expectEq( "-1 ? 'PASSED' : 'FAILED'", "PASSED", (-1?"PASSED":"FAILED"));
array[item++] = Assert.expectEq( "NaN ? 'FAILED' : 'PASSED'", "PASSED", (Number.NaN?"FAILED":"PASSED"));
array[item++] = Assert.expectEq( "var VAR = true ? , : 'FAILED'", "PASSED", (VAR = true ? "PASSED" : "FAILED") );
return ( array );
}

View File

@ -0,0 +1,13 @@
<flex-config>
<compiler>
<source-path>
<path-element>.</path-element>
<path-element>../../../lib</path-element>
</source-path>
<debug>false</debug>
<omit-trace-statements>false</omit-trace-statements>
<show-actionscript-warnings>false</show-actionscript-warnings>
<strict>false</strict>
</compiler>
<output>test.swf</output>
</flex-config>

View File

@ -0,0 +1,7 @@
true ? 'PASSED' : 'FAILED' PASSED!
false ? 'FAILED' : 'PASSED' PASSED!
1 ? 'PASSED' : 'FAILED' PASSED!
0 ? 'FAILED' : 'PASSED' PASSED!
-1 ? 'PASSED' : 'FAILED' PASSED!
NaN ? 'FAILED' : 'PASSED' PASSED!
var VAR = true ? , : 'FAILED' PASSED!

View File

@ -0,0 +1 @@
num_ticks = 1

View File

@ -0,0 +1,23 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
package {
import flash.display.MovieClip; public class Test extends MovieClip {}
}
import com.adobe.test.Assert;
// var SECTION = "11_13_1";
// var VERSION = "ECMA_1";
var testcases = getTestCases();
function getTestCases() {
var array = new Array();
var item = 0;
array[item++] = Assert.expectEq( "SOMEVAR = true", true, SOMEVAR = true );
return ( array );
}

View File

@ -0,0 +1,13 @@
<flex-config>
<compiler>
<source-path>
<path-element>.</path-element>
<path-element>../../../lib</path-element>
</source-path>
<debug>false</debug>
<omit-trace-statements>false</omit-trace-statements>
<show-actionscript-warnings>false</show-actionscript-warnings>
<strict>false</strict>
</compiler>
<output>test.swf</output>
</flex-config>

View File

@ -0,0 +1 @@
SOMEVAR = true PASSED!

View File

@ -0,0 +1 @@
num_ticks = 1

View File

@ -0,0 +1,93 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
package {
import flash.display.MovieClip; public class Test extends MovieClip {}
}
import com.adobe.test.Assert;
// var SECTION = "11_13_2_1";
// var VERSION = "ECMA_1";
var testcases = getTestCases();
function getTestCases()
{
var array = new Array();
var item = 0;
// NaN cases
VAR1 = Number.NaN; VAR2=1;
array[item++] = Assert.expectEq( "VAR1 = NaN; VAR2=1; VAR1 *= VAR2", Number.NaN, VAR1 *= VAR2 );
VAR1 = Number.NaN; VAR2=1; VAR1 *= VAR2;
array[item++] = Assert.expectEq( "VAR1 = NaN; VAR2=1; VAR1 *= VAR2; VAR1", Number.NaN, VAR1 );
// number cases
VAR1 = 0; VAR2=1;
array[item++] = Assert.expectEq( "VAR1 = 0; VAR2=1; VAR1 *= VAR2", 0, VAR1 *= VAR2 );
VAR1 = 0; VAR2=1; VAR1 *= VAR2;
array[item++] = Assert.expectEq( "VAR1 = 0; VAR2=1; VAR1 *= VAR2;VAR1", 0, VAR1 );
VAR1 = 0XFF; VAR2 = 0XA;
array[item++] = Assert.expectEq( "VAR1 = 0xFF; VAR2 = 0xA, VAR1 *= VAR2", 2550, VAR1 *= VAR2 );
// special multiplication cases
VAR1 = 0; VAR2 = Number.POSITIVE_INFINITY; VAR1 *= VAR2;
array[item++] = Assert.expectEq( "VAR1 = 0; VAR2= Infinity; VAR1 *= VAR2", Number.NaN, VAR1 );
VAR1 = -0; VAR2 = Number.POSITIVE_INFINITY; VAR1 *= VAR2;
array[item++] = Assert.expectEq( "VAR1 = -0; VAR2= Infinity; VAR1 *= VAR2", Number.NaN, VAR1 );
VAR1 = -0; VAR2 = Number.NEGATIVE_INFINITY; VAR1 *= VAR2;
array[item++] = Assert.expectEq( "VAR1 = -0; VAR2= -Infinity; VAR1 *= VAR2", Number.NaN, VAR1 );
VAR1 = 0; VAR2 = Number.NEGATIVE_INFINITY; VAR1 *= VAR2;
array[item++] = Assert.expectEq( "VAR1 = 0; VAR2= -Infinity; VAR1 *= VAR2", Number.NaN, VAR1 );
VAR1 = 0; VAR2 = Number.POSITIVE_INFINITY; VAR2 *= VAR1;
array[item++] = Assert.expectEq( "VAR1 = 0; VAR2= Infinity; VAR2 *= VAR1", Number.NaN, VAR2 );
VAR1 = -0; VAR2 = Number.POSITIVE_INFINITY; VAR2 *= VAR1;
array[item++] = Assert.expectEq( "VAR1 = -0; VAR2= Infinity; VAR2 *= VAR1", Number.NaN, VAR2 );
VAR1 = -0; VAR2 = Number.NEGATIVE_INFINITY; VAR2 *= VAR1;
array[item++] = Assert.expectEq( "VAR1 = -0; VAR2= -Infinity; VAR2 *= VAR1", Number.NaN, VAR2 );
VAR1 = 0; VAR2 = Number.NEGATIVE_INFINITY; VAR2 *= VAR1;
array[item++] = Assert.expectEq( "VAR1 = 0; VAR2= -Infinity; VAR2 *= VAR1", Number.NaN, VAR2 );
VAR1 = Number.POSITIVE_INFINITY; VAR2 = Number.POSITIVE_INFINITY; VAR1 *= VAR2;
array[item++] = Assert.expectEq( "VAR1 = Infinity; VAR2= Infinity; VAR1 *= VAR2", Number.POSITIVE_INFINITY, VAR1 );
VAR1 = Number.POSITIVE_INFINITY; VAR2 = Number.NEGATIVE_INFINITY; VAR1 *= VAR2;
array[item++] = Assert.expectEq( "VAR1 = Infinity; VAR2= -Infinity; VAR1 *= VAR2", Number.NEGATIVE_INFINITY, VAR1 );
VAR1 = Number.NEGATIVE_INFINITY; VAR2 = Number.POSITIVE_INFINITY; VAR1 *= VAR2;
array[item++] = Assert.expectEq( "VAR1 =-Infinity; VAR2= Infinity; VAR1 *= VAR2", Number.NEGATIVE_INFINITY, VAR1 );
VAR1 = Number.NEGATIVE_INFINITY; VAR2 = Number.NEGATIVE_INFINITY; VAR1 *= VAR2;
array[item++] = Assert.expectEq( "VAR1 =-Infinity; VAR2=-Infinity; VAR1 *= VAR2", Number.POSITIVE_INFINITY, VAR1 );
// string cases
VAR1 = 10; VAR2 = '255';
array[item++] = Assert.expectEq( "VAR1 = 10; VAR2 = '255', VAR1 *= VAR2", 2550, VAR1 *= VAR2 );
VAR1 = '255'; VAR2 = 10;
array[item++] = Assert.expectEq( "VAR1 = '255'; VAR2 = 10, VAR1 *= VAR2", 2550, VAR1 *= VAR2 );
VAR1 = 10; VAR2 = '0XFF';
array[item++] = Assert.expectEq( "VAR1 = 10; VAR2 = '0XFF', VAR1 *= VAR2", 2550, VAR1 *= VAR2 );
VAR1 = '0XFF'; VAR2 = 0XA;
array[item++] = Assert.expectEq( "VAR1 = '0xFF'; VAR2 = 0xA, VAR1 *= VAR2", 2550, VAR1 *= VAR2 );
VAR1 = '10'; VAR2 = '255';
array[item++] = Assert.expectEq( "VAR1 = '10'; VAR2 = '255', VAR1 *= VAR2", 2550, VAR1 *= VAR2);
VAR1 = '10'; VAR2 = '0XFF';
array[item++] = Assert.expectEq( "VAR1 = '10'; VAR2 = '0XFF', VAR1 *= VAR2", 2550, VAR1 *= VAR2);
VAR1 = '0XFF'; VAR2 = 0XA;
array[item++] = Assert.expectEq( "VAR1 = '0xFF'; VAR2 = 0xA, VAR1 *= VAR2", 2550, VAR1 *= VAR2);
// boolean cases
VAR1 = true; VAR2 = false;
array[item++] = Assert.expectEq( "VAR1 = true; VAR2 = false; VAR1 *= VAR2", 0, VAR1 *= VAR2 );
VAR1 = true; VAR2 = true;
array[item++] = Assert.expectEq( "VAR1 = true; VAR2 = true; VAR1 *= VAR2", 1, VAR1 *= VAR2);
// object cases
VAR1 = new Boolean(true); VAR2 = 10; VAR1 *= VAR2;
array[item++] = Assert.expectEq( "VAR1 = new Boolean(true); VAR2 = 10; VAR1 *= VAR2;VAR1", 10, VAR1 );
VAR1 = new Number(11); VAR2 = 10; VAR1 *= VAR2;
array[item++] = Assert.expectEq( "VAR1 = new Number(11); VAR2 = 10; VAR1 *= VAR2; VAR1", 110, VAR1);
VAR1 = new Number(11); VAR2 = new Number(10);
array[item++] = Assert.expectEq( "VAR1 = new Number(11); VAR2 = new Number(10); VAR1 *= VAR2", 110, VAR1 *= VAR2 );
VAR1 = String('15'); VAR2 = new String('0xF');
array[item++] = Assert.expectEq( "VAR1 = new String('15'); VAR2 = new String('0xF'); VAR1 *= VAR2", 225, VAR1 *= VAR2);
return ( array );
}

View File

@ -0,0 +1,13 @@
<flex-config>
<compiler>
<source-path>
<path-element>.</path-element>
<path-element>../../../lib</path-element>
</source-path>
<debug>false</debug>
<omit-trace-statements>false</omit-trace-statements>
<show-actionscript-warnings>false</show-actionscript-warnings>
<strict>false</strict>
</compiler>
<output>test.swf</output>
</flex-config>

View File

@ -0,0 +1,30 @@
VAR1 = NaN; VAR2=1; VAR1 *= VAR2 PASSED!
VAR1 = NaN; VAR2=1; VAR1 *= VAR2; VAR1 PASSED!
VAR1 = 0; VAR2=1; VAR1 *= VAR2 PASSED!
VAR1 = 0; VAR2=1; VAR1 *= VAR2;VAR1 PASSED!
VAR1 = 0xFF; VAR2 = 0xA, VAR1 *= VAR2 PASSED!
VAR1 = 0; VAR2= Infinity; VAR1 *= VAR2 PASSED!
VAR1 = -0; VAR2= Infinity; VAR1 *= VAR2 PASSED!
VAR1 = -0; VAR2= -Infinity; VAR1 *= VAR2 PASSED!
VAR1 = 0; VAR2= -Infinity; VAR1 *= VAR2 PASSED!
VAR1 = 0; VAR2= Infinity; VAR2 *= VAR1 PASSED!
VAR1 = -0; VAR2= Infinity; VAR2 *= VAR1 PASSED!
VAR1 = -0; VAR2= -Infinity; VAR2 *= VAR1 PASSED!
VAR1 = 0; VAR2= -Infinity; VAR2 *= VAR1 PASSED!
VAR1 = Infinity; VAR2= Infinity; VAR1 *= VAR2 PASSED!
VAR1 = Infinity; VAR2= -Infinity; VAR1 *= VAR2 PASSED!
VAR1 =-Infinity; VAR2= Infinity; VAR1 *= VAR2 PASSED!
VAR1 =-Infinity; VAR2=-Infinity; VAR1 *= VAR2 PASSED!
VAR1 = 10; VAR2 = '255', VAR1 *= VAR2 PASSED!
VAR1 = '255'; VAR2 = 10, VAR1 *= VAR2 PASSED!
VAR1 = 10; VAR2 = '0XFF', VAR1 *= VAR2 PASSED!
VAR1 = '0xFF'; VAR2 = 0xA, VAR1 *= VAR2 PASSED!
VAR1 = '10'; VAR2 = '255', VAR1 *= VAR2 PASSED!
VAR1 = '10'; VAR2 = '0XFF', VAR1 *= VAR2 PASSED!
VAR1 = '0xFF'; VAR2 = 0xA, VAR1 *= VAR2 PASSED!
VAR1 = true; VAR2 = false; VAR1 *= VAR2 PASSED!
VAR1 = true; VAR2 = true; VAR1 *= VAR2 PASSED!
VAR1 = new Boolean(true); VAR2 = 10; VAR1 *= VAR2;VAR1 PASSED!
VAR1 = new Number(11); VAR2 = 10; VAR1 *= VAR2; VAR1 PASSED!
VAR1 = new Number(11); VAR2 = new Number(10); VAR1 *= VAR2 PASSED!
VAR1 = new String('15'); VAR2 = new String('0xF'); VAR1 *= VAR2 PASSED!

View File

@ -0,0 +1 @@
num_ticks = 1

View File

@ -0,0 +1,117 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
package {
import flash.display.MovieClip; public class Test extends MovieClip {}
}
import com.adobe.test.Assert;
// var SECTION = "e11_13_2_2";
// var VERSION = "ECMA_1";
var testcases = getTestCases();
function getTestCases() {
var array = new Array();
var item = 0;
// NaN cases
VAR1 = Number.NaN; VAR2=1;
array[item++] = Assert.expectEq( "VAR1 = NaN; VAR2=1; VAR1 /= VAR2", Number.NaN, VAR1 /= VAR2 );
VAR1 = Number.NaN; VAR2=1; VAR1 /= VAR2;
array[item++] = Assert.expectEq( "VAR1 = NaN; VAR2=1; VAR1 /= VAR2; VAR1", Number.NaN, VAR1 );
VAR1 = Number.NaN; VAR2=0;
array[item++] = Assert.expectEq( "VAR1 = NaN; VAR2=0; VAR1 /= VAR2", Number.NaN, VAR1 /= VAR2 );
VAR1 = Number.NaN; VAR2=0; VAR1 /= VAR2;
array[item++] = Assert.expectEq( "VAR1 = NaN; VAR2=0; VAR1 /= VAR2; VAR1", Number.NaN, VAR1 );
VAR1 = 0; VAR2=Number.NaN;
array[item++] = Assert.expectEq( "VAR1 = 0; VAR2=NaN; VAR1 /= VAR2", Number.NaN, VAR1 /= VAR2 );
VAR1 = 0; VAR2=Number.NaN; VAR1 /= VAR2;
array[item++] = Assert.expectEq( "VAR1 = 0; VAR2=NaN; VAR1 /= VAR2; VAR1", Number.NaN, VAR1 );
// number cases
VAR1 = 0; VAR2=1;
array[item++] = Assert.expectEq( "VAR1 = 0; VAR2=1; VAR1 /= VAR2", 0, VAR1 /= VAR2);
VAR1 = 0; VAR2=1; VAR1 /= VAR2;
array[item++] = Assert.expectEq( "VAR1 = 0; VAR2=1; VAR1 /= VAR2;VAR1", 0, VAR1);
VAR1 = 0XFF; VAR2 = 0XA;
array[item++] = Assert.expectEq( "VAR1 = 0xFF; VAR2 = 0xA, VAR1 /= VAR2", 25.5, VAR1 /= VAR2);
// special division cases
VAR1 = 0; VAR2 = Number.POSITIVE_INFINITY; VAR1 /= VAR2;
array[item++] = Assert.expectEq( "VAR1 = 0; VAR2= Infinity; VAR1 /= VAR2", 0, VAR1);
VAR1 = -0; VAR2 = Number.POSITIVE_INFINITY; VAR1 /= VAR2;
array[item++] = Assert.expectEq( "VAR1 = -0; VAR2= Infinity; VAR1 /= VAR2", 0, VAR1 );
VAR1 = -0; VAR2 = Number.NEGATIVE_INFINITY; VAR1 /= VAR2;
array[item++] = Assert.expectEq( "VAR1 = -0; VAR2= -Infinity; VAR1 /= VAR2", 0, VAR1);
VAR1 = 0; VAR2 = Number.NEGATIVE_INFINITY; VAR1 /= VAR2;
array[item++] = Assert.expectEq( "VAR1 = 0; VAR2= -Infinity; VAR1 /= VAR2", 0, VAR1);
VAR1 = 0; VAR2 = Number.POSITIVE_INFINITY; VAR2 /= VAR1;
array[item++] = Assert.expectEq( "VAR1 = 0; VAR2= Infinity; VAR2 /= VAR1", Number.POSITIVE_INFINITY, VAR2);
VAR1 = -0; VAR2 = Number.POSITIVE_INFINITY; VAR2 /= VAR1;
array[item++] = Assert.expectEq( "VAR1 = -0; VAR2= Infinity; VAR2 /= VAR1", Number.NEGATIVE_INFINITY, VAR2);
VAR1 = -0; VAR2 = Number.NEGATIVE_INFINITY; VAR2 /= VAR1;
array[item++] = Assert.expectEq( "VAR1 = -0; VAR2= -Infinity; VAR2 /= VAR1", Number.POSITIVE_INFINITY, VAR2);
VAR1 = 0; VAR2 = Number.NEGATIVE_INFINITY; VAR2 /= VAR1;
array[item++] = Assert.expectEq( "VAR1 = 0; VAR2= -Infinity; VAR2 /= VAR1", Number.NEGATIVE_INFINITY, VAR2);
VAR1 = Number.POSITIVE_INFINITY; VAR2 = Number.POSITIVE_INFINITY; VAR1 /= VAR2;
array[item++] = Assert.expectEq( "VAR1 = Infinity; VAR2= Infinity; VAR1 /= VAR2", Number.NaN, VAR1);
VAR1 = Number.POSITIVE_INFINITY; VAR2 = Number.NEGATIVE_INFINITY; VAR1 /= VAR2;
array[item++] = Assert.expectEq( "VAR1 = Infinity; VAR2= -Infinity; VAR1 /= VAR2", Number.NaN, VAR1);
VAR1 = Number.NEGATIVE_INFINITY; VAR2 = Number.POSITIVE_INFINITY; VAR1 /= VAR2;
array[item++] = Assert.expectEq( "VAR1 =-Infinity; VAR2= Infinity; VAR1 /= VAR2", Number.NaN, VAR1);
VAR1 = Number.NEGATIVE_INFINITY; VAR2 = Number.NEGATIVE_INFINITY; VAR1 /= VAR2;
array[item++] = Assert.expectEq( "VAR1 =-Infinity; VAR2=-Infinity; VAR1 /= VAR2", Number.NaN, VAR1);
VAR1 = 0; VAR2 = 0; VAR1 /= VAR2;
array[item++] = Assert.expectEq( "VAR1 = 0; VAR2= 0; VAR1 /= VAR2", Number.NaN, VAR1);
VAR1 = 0; VAR2 = -0; VAR1 /= VAR2;
array[item++] = Assert.expectEq( "VAR1 = 0; VAR2= -0; VAR1 /= VAR2", Number.NaN, VAR1);
VAR1 = -0; VAR2 = 0; VAR1 /= VAR2;
array[item++] = Assert.expectEq( "VAR1 = -0; VAR2= 0; VAR1 /= VAR2", Number.NaN, VAR1);
VAR1 = -0; VAR2 = -0; VAR1 /= VAR2;
array[item++] = Assert.expectEq( "VAR1 = -0; VAR2= -0; VAR1 /= VAR2", Number.NaN, VAR1);
VAR1 = 1; VAR2 = 0; VAR1 /= VAR2;
array[item++] = Assert.expectEq( "VAR1 = 1; VAR2= 0; VAR1 /= VAR2", Number.POSITIVE_INFINITY, VAR1 );
VAR1 = 1; VAR2 = -0; VAR1 /= VAR2;
array[item++] = Assert.expectEq( "VAR1 = 1; VAR2= -0; VAR1 /= VAR2", Number.NEGATIVE_INFINITY, VAR1);
VAR1 = -1; VAR2 = 0; VAR1 /= VAR2;
array[item++] = Assert.expectEq( "VAR1 = -1; VAR2= 0; VAR1 /= VAR2", Number.NEGATIVE_INFINITY, VAR1);
VAR1 = -1; VAR2 = -0; VAR1 /= VAR2;
array[item++] = Assert.expectEq( "VAR1 = -1; VAR2= -0; VAR1 /= VAR2", Number.POSITIVE_INFINITY, VAR1);
// string cases
VAR1 = 1000; VAR2 = '10', VAR1 /= VAR2;
array[item++] = Assert.expectEq( "VAR1 = 1000; VAR2 = '10', VAR1 /= VAR2; VAR1", 100, VAR1);
VAR1 = '1000'; VAR2 = 10, VAR1 /= VAR2;
array[item++] = Assert.expectEq( "VAR1 = '1000'; VAR2 = 10, VAR1 /= VAR2; VAR1", 100, VAR1);
/*
VAR1 = 10; VAR2 = '0XFF';
array[item++] = Assert.expectEq( "VAR1 = 10; VAR2 = '0XFF', VAR1 /= VAR2", 2550, VAR1 /= VAR2);
VAR1 = '0XFF'; VAR2 = 0XA;
array[item++] = Assert.expectEq( "VAR1 = '0xFF'; VAR2 = 0xA, VAR1 /= VAR2", 2550, VAR1 /= VAR2);
VAR1 = '10'; VAR2 = '255';
array[item++] = Assert.expectEq( "VAR1 = '10'; VAR2 = '255', VAR1 /= VAR2", 2550, VAR1 /= VAR2);
VAR1 = '10'; VAR2 = '0XFF';
array[item++] = Assert.expectEq( "VAR1 = '10'; VAR2 = '0XFF', VAR1 /= VAR2", 2550, VAR1 /= VAR2);
VAR1 = '0XFF'; VAR2 = 0XA;
array[item++] = Assert.expectEq( "VAR1 = '0xFF'; VAR2 = 0xA, VAR1 /= VAR2", 2550, VAR1 /= VAR2);
// boolean cases
VAR1 = true; VAR2 = false;
array[item++] = Assert.expectEq( "VAR1 = true; VAR2 = false; VAR1 /= VAR2", 0, VAR1 /= VAR2);
VAR1 = true; VAR2 = true;
array[item++] = Assert.expectEq( "VAR1 = true; VAR2 = true; VAR1 /= VAR2", 1, VAR1 /= VAR2);
// object cases
VAR1 = new Boolean(true); VAR2 = 10; VAR1 /= VAR2;
array[item++] = Assert.expectEq( "VAR1 = new Boolean(true); VAR2 = 10; VAR1 /= VAR2;VAR1", 10, VAR1);
VAR1 = new Number(11); VAR2 = 10; VAR1 /= VAR2;
array[item++] = Assert.expectEq( "VAR1 = new Number(11); VAR2 = 10; VAR1 /= VAR2; VAR1", 110, VAR1);
VAR1 = new Number(11); VAR2 = new Number(10);
array[item++] = Assert.expectEq( "VAR1 = new Number(11); VAR2 = new Number(10); VAR1 /= VAR2", 110, VAR1 /= VAR2);
VAR1 = String('15'); VAR2 = new String('0xF');
array[item++] = Assert.expectEq( "VAR1 = new String('15'); VAR2 = new String('0xF'); VAR1 /= VAR2", 255, VAR1 /= VAR2);
*/
return ( array );
}

View File

@ -0,0 +1,13 @@
<flex-config>
<compiler>
<source-path>
<path-element>.</path-element>
<path-element>../../../lib</path-element>
</source-path>
<debug>false</debug>
<omit-trace-statements>false</omit-trace-statements>
<show-actionscript-warnings>false</show-actionscript-warnings>
<strict>false</strict>
</compiler>
<output>test.swf</output>
</flex-config>

View File

@ -0,0 +1,31 @@
VAR1 = NaN; VAR2=1; VAR1 /= VAR2 PASSED!
VAR1 = NaN; VAR2=1; VAR1 /= VAR2; VAR1 PASSED!
VAR1 = NaN; VAR2=0; VAR1 /= VAR2 PASSED!
VAR1 = NaN; VAR2=0; VAR1 /= VAR2; VAR1 PASSED!
VAR1 = 0; VAR2=NaN; VAR1 /= VAR2 PASSED!
VAR1 = 0; VAR2=NaN; VAR1 /= VAR2; VAR1 PASSED!
VAR1 = 0; VAR2=1; VAR1 /= VAR2 PASSED!
VAR1 = 0; VAR2=1; VAR1 /= VAR2;VAR1 PASSED!
VAR1 = 0xFF; VAR2 = 0xA, VAR1 /= VAR2 PASSED!
VAR1 = 0; VAR2= Infinity; VAR1 /= VAR2 PASSED!
VAR1 = -0; VAR2= Infinity; VAR1 /= VAR2 PASSED!
VAR1 = -0; VAR2= -Infinity; VAR1 /= VAR2 PASSED!
VAR1 = 0; VAR2= -Infinity; VAR1 /= VAR2 PASSED!
VAR1 = 0; VAR2= Infinity; VAR2 /= VAR1 PASSED!
VAR1 = -0; VAR2= Infinity; VAR2 /= VAR1 PASSED!
VAR1 = -0; VAR2= -Infinity; VAR2 /= VAR1 PASSED!
VAR1 = 0; VAR2= -Infinity; VAR2 /= VAR1 PASSED!
VAR1 = Infinity; VAR2= Infinity; VAR1 /= VAR2 PASSED!
VAR1 = Infinity; VAR2= -Infinity; VAR1 /= VAR2 PASSED!
VAR1 =-Infinity; VAR2= Infinity; VAR1 /= VAR2 PASSED!
VAR1 =-Infinity; VAR2=-Infinity; VAR1 /= VAR2 PASSED!
VAR1 = 0; VAR2= 0; VAR1 /= VAR2 PASSED!
VAR1 = 0; VAR2= -0; VAR1 /= VAR2 PASSED!
VAR1 = -0; VAR2= 0; VAR1 /= VAR2 PASSED!
VAR1 = -0; VAR2= -0; VAR1 /= VAR2 PASSED!
VAR1 = 1; VAR2= 0; VAR1 /= VAR2 PASSED!
VAR1 = 1; VAR2= -0; VAR1 /= VAR2 PASSED!
VAR1 = -1; VAR2= 0; VAR1 /= VAR2 PASSED!
VAR1 = -1; VAR2= -0; VAR1 /= VAR2 PASSED!
VAR1 = 1000; VAR2 = '10', VAR1 /= VAR2; VAR1 PASSED!
VAR1 = '1000'; VAR2 = 10, VAR1 /= VAR2; VAR1 PASSED!

View File

@ -0,0 +1 @@
num_ticks = 1

View File

@ -0,0 +1,137 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
package {
import flash.display.MovieClip; public class Test extends MovieClip {}
}
import com.adobe.test.Assert;
// var SECTION = "e11_13_2_3";
// var VERSION = "ECMA_1";
var testcases = getTestCases();
function getTestCases() {
var array = new Array();
var item = 0;
// If either operand is NaN, result is NaN
VAR1 = Number.NaN; VAR2=1;
array[item++] = Assert.expectEq( "VAR1 = NaN; VAR2=1; VAR1 %= VAR2", Number.NaN, VAR1 %= VAR2);
VAR1 = Number.NaN; VAR2=1; VAR1 %= VAR2;
array[item++] = Assert.expectEq( "VAR1 = NaN; VAR2=1; VAR1 %= VAR2; VAR1", Number.NaN, VAR1);
VAR1 = Number.NaN; VAR2=0;
array[item++] = Assert.expectEq( "VAR1 = NaN; VAR2=0; VAR1 %= VAR2", Number.NaN, VAR1 %= VAR2);
VAR1 = Number.NaN; VAR2=0; VAR1 %= VAR2;
array[item++] = Assert.expectEq( "VAR1 = NaN; VAR2=0; VAR1 %= VAR2; VAR1", Number.NaN, VAR1);
VAR1 = 0; VAR2=Number.NaN;
array[item++] = Assert.expectEq( "VAR1 = 0; VAR2=NaN; VAR1 %= VAR2", Number.NaN, VAR1 %= VAR2);
VAR1 = 0; VAR2=Number.NaN; VAR1 %= VAR2;
array[item++] = Assert.expectEq( "VAR1 = 0; VAR2=NaN; VAR1 %= VAR2; VAR1", Number.NaN, VAR1 );
// if the dividend is infinity or the divisor is zero or both, the result is NaN
VAR1 = Number.POSITIVE_INFINITY; VAR2 = Number.POSITIVE_INFINITY; VAR1 %= VAR2;
array[item++] = Assert.expectEq( "VAR1 = Infinity; VAR2= Infinity; VAR1 %= VAR2; VAR1", Number.NaN, VAR1 );
VAR1 = Number.POSITIVE_INFINITY; VAR2 = Number.NEGATIVE_INFINITY; VAR1 %= VAR2;
array[item++] = Assert.expectEq( "VAR1 = Infinity; VAR2= -Infinity; VAR1 %= VAR2; VAR1", Number.NaN, VAR1 );
VAR1 = Number.NEGATIVE_INFINITY; VAR2 = Number.POSITIVE_INFINITY; VAR1 %= VAR2;
array[item++] = Assert.expectEq( "VAR1 =-Infinity; VAR2= Infinity; VAR1 %= VAR2; VAR1", Number.NaN, VAR1 );
VAR1 = Number.NEGATIVE_INFINITY; VAR2 = Number.NEGATIVE_INFINITY; VAR1 %= VAR2;
array[item++] = Assert.expectEq( "VAR1 =-Infinity; VAR2=-Infinity; VAR1 %= VAR2; VAR1", Number.NaN, VAR1);
VAR1 = 0; VAR2 = Number.POSITIVE_INFINITY; VAR2 %= VAR1;
array[item++] = Assert.expectEq( "VAR1 = 0; VAR2= Infinity; VAR2 %= VAR1", Number.NaN, VAR2);
VAR1 = -0; VAR2 = Number.POSITIVE_INFINITY; VAR2 %= VAR1;
array[item++] = Assert.expectEq( "VAR1 = -0; VAR2= Infinity; VAR2 %= VAR1", Number.NaN, VAR2);
VAR1 = -0; VAR2 = Number.NEGATIVE_INFINITY; VAR2 %= VAR1;
array[item++] = Assert.expectEq( "VAR1 = -0; VAR2= -Infinity; VAR2 %= VAR1", Number.NaN, VAR2);
VAR1 = 0; VAR2 = Number.NEGATIVE_INFINITY; VAR2 %= VAR1;
array[item++] = Assert.expectEq( "VAR1 = 0; VAR2= -Infinity; VAR2 %= VAR1", Number.NaN, VAR2);
VAR1 = 1; VAR2 = Number.POSITIVE_INFINITY; VAR2 %= VAR1;
array[item++] = Assert.expectEq( "VAR1 = 1; VAR2= Infinity; VAR2 %= VAR1", Number.NaN, VAR2);
VAR1 = -1; VAR2 = Number.POSITIVE_INFINITY; VAR2 %= VAR1;
array[item++] = Assert.expectEq( "VAR1 = -1; VAR2= Infinity; VAR2 %= VAR1", Number.NaN, VAR2);
VAR1 = -1; VAR2 = Number.NEGATIVE_INFINITY; VAR2 %= VAR1;
array[item++] = Assert.expectEq( "VAR1 = -1; VAR2= -Infinity; VAR2 %= VAR1", Number.NaN, VAR2);
VAR1 = 1; VAR2 = Number.NEGATIVE_INFINITY; VAR2 %= VAR1;
array[item++] = Assert.expectEq( "VAR1 = 1; VAR2= -Infinity; VAR2 %= VAR1", Number.NaN, VAR2);
VAR1 = 0; VAR2 = 0; VAR1 %= VAR2;
array[item++] = Assert.expectEq( "VAR1 = 0; VAR2= 0; VAR1 %= VAR2", Number.NaN, VAR1 );
VAR1 = 0; VAR2 = -0; VAR1 %= VAR2;
array[item++] = Assert.expectEq( "VAR1 = 0; VAR2= -0; VAR1 %= VAR2", Number.NaN, VAR1 );
VAR1 = -0; VAR2 = 0; VAR1 %= VAR2;
array[item++] = Assert.expectEq( "VAR1 = -0; VAR2= 0; VAR1 %= VAR2", Number.NaN, VAR1 );
VAR1 = -0; VAR2 = -0; VAR1 %= VAR2;
array[item++] = Assert.expectEq( "VAR1 = -0; VAR2= -0; VAR1 %= VAR2", Number.NaN, VAR1 );
VAR1 = 1; VAR2 = 0; VAR1 %= VAR2;
array[item++] = Assert.expectEq( "VAR1 = 1; VAR2= 0; VAR1 %= VAR2", Number.NaN, VAR1 );
VAR1 = 1; VAR2 = -0; VAR1 %= VAR2;
array[item++] = Assert.expectEq( "VAR1 = 1; VAR2= -0; VAR1 %= VAR2", Number.NaN, VAR1 );
VAR1 = -1; VAR2 = 0; VAR1 %= VAR2;
array[item++] = Assert.expectEq( "VAR1 = -1; VAR2= 0; VAR1 %= VAR2", Number.NaN, VAR1 );
VAR1 = -1; VAR2 = -0; VAR1 %= VAR2;
array[item++] = Assert.expectEq( "VAR1 = -1; VAR2= -0; VAR1 %= VAR2", Number.NaN, VAR1 );
// if the dividend is finite and the divisor is an infinity, the result equals the dividend.
VAR1 = 0; VAR2 = Number.POSITIVE_INFINITY; VAR1 %= VAR2;
array[item++] = Assert.expectEq( "VAR1 = 0; VAR2= Infinity; VAR1 %= VAR2;VAR1", 0, VAR1 );
VAR1 = -0; VAR2 = Number.POSITIVE_INFINITY; VAR1 %= VAR2;
array[item++] = Assert.expectEq( "VAR1 = -0; VAR2= Infinity; VAR1 %= VAR2;VAR1", -0, VAR1 );
VAR1 = -0; VAR2 = Number.NEGATIVE_INFINITY; VAR1 %= VAR2;
array[item++] = Assert.expectEq( "VAR1 = -0; VAR2= -Infinity; VAR1 %= VAR2;VAR1", -0, VAR1 );
VAR1 = 0; VAR2 = Number.NEGATIVE_INFINITY; VAR1 %= VAR2;
array[item++] = Assert.expectEq( "VAR1 = 0; VAR2= -Infinity; VAR1 %= VAR2;VAR1", 0, VAR1 );
VAR1 = 1; VAR2 = Number.POSITIVE_INFINITY; VAR1 %= VAR2;
array[item++] = Assert.expectEq( "VAR1 = 1; VAR2= Infinity; VAR1 %= VAR2;VAR1", 1, VAR1 );
VAR1 = -1; VAR2 = Number.POSITIVE_INFINITY; VAR1 %= VAR2;
array[item++] = Assert.expectEq( "VAR1 = -1; VAR2= Infinity; VAR1 %= VAR2;VAR1", -1, VAR1 );
VAR1 = -1; VAR2 = Number.NEGATIVE_INFINITY; VAR1 %= VAR2;
array[item++] = Assert.expectEq( "VAR1 = -1; VAR2= -Infinity; VAR1 %= VAR2;VAR1", -1, VAR1 );
VAR1 = 1; VAR2 = Number.NEGATIVE_INFINITY; VAR1 %= VAR2;
array[item++] = Assert.expectEq( "VAR1 = 1; VAR2= -Infinity; VAR1 %= VAR2;VAR1", 1, VAR1 );
// if the dividend is a zero and the divisor is finite, the result is the same as the dividend
VAR1 = 0; VAR2 = 1; VAR1 %= VAR2;
array[item++] = Assert.expectEq( "VAR1 = 0; VAR2= 1; VAR1 %= VAR2; VAR1", 0, VAR1 );
VAR1 = -0; VAR2 = 1; VAR1 %= VAR2;
array[item++] = Assert.expectEq( "VAR1 = -0; VAR2= 1; VAR1 %= VAR2; VAR1", -0, VAR1 );
VAR1 = -0; VAR2 = -1; VAR1 %= VAR2;
array[item++] = Assert.expectEq( "VAR1 = -0; VAR2= -1; VAR1 %= VAR2; VAR1", -0, VAR1 );
VAR1 = 0; VAR2 = -1; VAR1 %= VAR2;
array[item++] = Assert.expectEq( "VAR1 = 0; VAR2= -1; VAR1 %= VAR2; VAR1", 0, VAR1 );
// string cases
VAR1 = 1000; VAR2 = '10', VAR1 %= VAR2;
array[item++] = Assert.expectEq( "VAR1 = 1000; VAR2 = '10', VAR1 %= VAR2; VAR1", 0, VAR1 );
VAR1 = '1000'; VAR2 = 10, VAR1 %= VAR2;
array[item++] = Assert.expectEq( "VAR1 = '1000'; VAR2 = 10, VAR1 %= VAR2; VAR1", 0, VAR1 );
/*
VAR1 = 10; VAR2 = '0XFF';
array[item++] = Assert.expectEq( "VAR1 = 10; VAR2 = '0XFF', VAR1 %= VAR2", 2550, VAR1 %= VAR2 );
VAR1 = '0XFF'; VAR2 = 0XA;
array[item++] = Assert.expectEq( "VAR1 = '0xFF'; VAR2 = 0xA, VAR1 %= VAR2", 2550, VAR1 %= VAR2 );
VAR1 = '10'; VAR2 = '255';
array[item++] = Assert.expectEq( "VAR1 = '10'; VAR2 = '255', VAR1 %= VAR2", 2550, VAR1 %= VAR2 );
VAR1 = '10'; VAR2 = '0XFF';
array[item++] = Assert.expectEq( "VAR1 = '10'; VAR2 = '0XFF', VAR1 %= VAR2", 2550, VAR1 %= VAR2 );
VAR1 = '0XFF'; VAR2 = 0XA;
array[item++] = Assert.expectEq( "VAR1 = '0xFF'; VAR2 = 0xA, VAR1 %= VAR2", 2550, VAR1 %= VAR2 );
// boolean cases
VAR1 = true; VAR2 = false;
array[item++] = Assert.expectEq( "VAR1 = true; VAR2 = false; VAR1 %= VAR2", 0, VAR1 %= VAR2 );
VAR1 = true; VAR2 = true;
array[item++] = Assert.expectEq( "VAR1 = true; VAR2 = true; VAR1 %= VAR2", 1, VAR1 %= VAR2 );
// object cases
VAR1 = new Boolean(true); VAR2 = 10; VAR1 %= VAR2;
array[item++] = Assert.expectEq( "VAR1 = new Boolean(true); VAR2 = 10; VAR1 %= VAR2;VAR1", 10, VAR1 );
VAR1 = new Number(11); VAR2 = 10; VAR1 %= VAR2;
array[item++] = Assert.expectEq( "VAR1 = new Number(11); VAR2 = 10; VAR1 %= VAR2; VAR1", 110, VAR1 );
VAR1 = new Number(11); VAR2 = new Number(10);
array[item++] = Assert.expectEq( "VAR1 = new Number(11); VAR2 = new Number(10); VAR1 %= VAR2", 110, VAR1 %= VAR2 );
VAR1 = String('15'); VAR2 = new String('0xF');
array[item++] = Assert.expectEq( "VAR1 = new String('15'); VAR2 = new String('0xF'); VAR1 %= VAR2", 255, VAR1 %= VAR2 );
*/
return ( array );
}

View File

@ -0,0 +1,13 @@
<flex-config>
<compiler>
<source-path>
<path-element>.</path-element>
<path-element>../../../lib</path-element>
</source-path>
<debug>false</debug>
<omit-trace-statements>false</omit-trace-statements>
<show-actionscript-warnings>false</show-actionscript-warnings>
<strict>false</strict>
</compiler>
<output>test.swf</output>
</flex-config>

View File

@ -0,0 +1,40 @@
VAR1 = NaN; VAR2=1; VAR1 %= VAR2 PASSED!
VAR1 = NaN; VAR2=1; VAR1 %= VAR2; VAR1 PASSED!
VAR1 = NaN; VAR2=0; VAR1 %= VAR2 PASSED!
VAR1 = NaN; VAR2=0; VAR1 %= VAR2; VAR1 PASSED!
VAR1 = 0; VAR2=NaN; VAR1 %= VAR2 PASSED!
VAR1 = 0; VAR2=NaN; VAR1 %= VAR2; VAR1 PASSED!
VAR1 = Infinity; VAR2= Infinity; VAR1 %= VAR2; VAR1 PASSED!
VAR1 = Infinity; VAR2= -Infinity; VAR1 %= VAR2; VAR1 PASSED!
VAR1 =-Infinity; VAR2= Infinity; VAR1 %= VAR2; VAR1 PASSED!
VAR1 =-Infinity; VAR2=-Infinity; VAR1 %= VAR2; VAR1 PASSED!
VAR1 = 0; VAR2= Infinity; VAR2 %= VAR1 PASSED!
VAR1 = -0; VAR2= Infinity; VAR2 %= VAR1 PASSED!
VAR1 = -0; VAR2= -Infinity; VAR2 %= VAR1 PASSED!
VAR1 = 0; VAR2= -Infinity; VAR2 %= VAR1 PASSED!
VAR1 = 1; VAR2= Infinity; VAR2 %= VAR1 PASSED!
VAR1 = -1; VAR2= Infinity; VAR2 %= VAR1 PASSED!
VAR1 = -1; VAR2= -Infinity; VAR2 %= VAR1 PASSED!
VAR1 = 1; VAR2= -Infinity; VAR2 %= VAR1 PASSED!
VAR1 = 0; VAR2= 0; VAR1 %= VAR2 PASSED!
VAR1 = 0; VAR2= -0; VAR1 %= VAR2 PASSED!
VAR1 = -0; VAR2= 0; VAR1 %= VAR2 PASSED!
VAR1 = -0; VAR2= -0; VAR1 %= VAR2 PASSED!
VAR1 = 1; VAR2= 0; VAR1 %= VAR2 PASSED!
VAR1 = 1; VAR2= -0; VAR1 %= VAR2 PASSED!
VAR1 = -1; VAR2= 0; VAR1 %= VAR2 PASSED!
VAR1 = -1; VAR2= -0; VAR1 %= VAR2 PASSED!
VAR1 = 0; VAR2= Infinity; VAR1 %= VAR2;VAR1 PASSED!
VAR1 = -0; VAR2= Infinity; VAR1 %= VAR2;VAR1 PASSED!
VAR1 = -0; VAR2= -Infinity; VAR1 %= VAR2;VAR1 PASSED!
VAR1 = 0; VAR2= -Infinity; VAR1 %= VAR2;VAR1 PASSED!
VAR1 = 1; VAR2= Infinity; VAR1 %= VAR2;VAR1 PASSED!
VAR1 = -1; VAR2= Infinity; VAR1 %= VAR2;VAR1 PASSED!
VAR1 = -1; VAR2= -Infinity; VAR1 %= VAR2;VAR1 PASSED!
VAR1 = 1; VAR2= -Infinity; VAR1 %= VAR2;VAR1 PASSED!
VAR1 = 0; VAR2= 1; VAR1 %= VAR2; VAR1 PASSED!
VAR1 = -0; VAR2= 1; VAR1 %= VAR2; VAR1 PASSED!
VAR1 = -0; VAR2= -1; VAR1 %= VAR2; VAR1 PASSED!
VAR1 = 0; VAR2= -1; VAR1 %= VAR2; VAR1 PASSED!
VAR1 = 1000; VAR2 = '10', VAR1 %= VAR2; VAR1 PASSED!
VAR1 = '1000'; VAR2 = 10, VAR1 %= VAR2; VAR1 PASSED!

View File

@ -0,0 +1 @@
num_ticks = 1

View File

@ -0,0 +1,115 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
package {
import flash.display.MovieClip; public class Test extends MovieClip {}
}
import com.adobe.test.Assert;
// var SECTION = "11_13_2_4";
// var VERSION = "ECMA_1";
var testcases = getTestCases();
function getTestCases() {
var array = new Array();
var item = 0;
// If either operand is NaN, result is NaN
VAR1 = Number.NaN; VAR2=1;
array[item++] = Assert.expectEq( "VAR1 = NaN; VAR2=1; VAR1 += VAR2", Number.NaN, VAR1 += VAR2 );
VAR1 = Number.NaN; VAR2=1; VAR1 += VAR2;
array[item++] = Assert.expectEq( "VAR1 = NaN; VAR2=1; VAR1 += VAR2; VAR1", Number.NaN, VAR1 );
VAR1 = Number.NaN; VAR2=0;
array[item++] = Assert.expectEq( "VAR1 = NaN; VAR2=0; VAR1 += VAR2", Number.NaN, VAR1 += VAR2 );
VAR1 = Number.NaN; VAR2=0; VAR1 += VAR2;
array[item++] = Assert.expectEq( "VAR1 = NaN; VAR2=0; VAR1 += VAR2; VAR1", Number.NaN, VAR1 );
VAR1 = 0; VAR2=Number.NaN;
array[item++] = Assert.expectEq( "VAR1 = 0; VAR2=NaN; VAR1 += VAR2", Number.NaN, VAR1 += VAR2 );
VAR1 = 0; VAR2=Number.NaN; VAR1 += VAR2;
array[item++] = Assert.expectEq( "VAR1 = 0; VAR2=NaN; VAR1 += VAR2; VAR1", Number.NaN, VAR1 );
// the sum of two Infinities the same sign is the infinity of that sign
// the sum of two Infinities of opposite sign is NaN
VAR1 = Number.POSITIVE_INFINITY; VAR2 = Number.POSITIVE_INFINITY; VAR1 += VAR2;
array[item++] = Assert.expectEq( "VAR1 = Infinity; VAR2= Infinity; VAR1 += VAR2; VAR1", Number.POSITIVE_INFINITY, VAR1 );
VAR1 = Number.POSITIVE_INFINITY; VAR2 = Number.NEGATIVE_INFINITY; VAR1 += VAR2;
array[item++] = Assert.expectEq( "VAR1 = Infinity; VAR2= -Infinity; VAR1 += VAR2; VAR1", Number.NaN, VAR1 );
VAR1 = Number.NEGATIVE_INFINITY; VAR2 = Number.POSITIVE_INFINITY; VAR1 += VAR2;
array[item++] = Assert.expectEq( "VAR1 =-Infinity; VAR2= Infinity; VAR1 += VAR2; VAR1", Number.NaN, VAR1 );
VAR1 = Number.NEGATIVE_INFINITY; VAR2 = Number.NEGATIVE_INFINITY; VAR1 += VAR2;
array[item++] = Assert.expectEq( "VAR1 =-Infinity; VAR2=-Infinity; VAR1 += VAR2; VAR1", Number.NEGATIVE_INFINITY, VAR1 );
// the sum of an infinity and a finite value is equal to the infinite operand
VAR1 = 0; VAR2 = Number.POSITIVE_INFINITY; VAR1 += VAR2;
array[item++] = Assert.expectEq( "VAR1 = 0; VAR2= Infinity; VAR1 += VAR2;VAR1", Number.POSITIVE_INFINITY, VAR1 );
VAR1 = -0; VAR2 = Number.POSITIVE_INFINITY; VAR1 += VAR2;
array[item++] = Assert.expectEq( "VAR1 = -0; VAR2= Infinity; VAR1 += VAR2;VAR1", Number.POSITIVE_INFINITY, VAR1 );
VAR1 = -0; VAR2 = Number.NEGATIVE_INFINITY; VAR1 += VAR2;
array[item++] = Assert.expectEq( "VAR1 = -0; VAR2= -Infinity; VAR1 += VAR2;VAR1", Number.NEGATIVE_INFINITY, VAR1 );
VAR1 = 0; VAR2 = Number.NEGATIVE_INFINITY; VAR1 += VAR2;
array[item++] = Assert.expectEq( "VAR1 = 0; VAR2= -Infinity; VAR1 += VAR2;VAR1", Number.NEGATIVE_INFINITY, VAR1 );
// the sum of two negative zeros is -0. the sum of two positive zeros, or of two zeros of opposite sign, is +0
VAR1 = 0; VAR2 = 0; VAR1 += VAR2;
array[item++] = Assert.expectEq( "VAR1 = 0; VAR2= 0; VAR1 += VAR2", 0, VAR1 );
VAR1 = 0; VAR2 = -0; VAR1 += VAR2;
array[item++] = Assert.expectEq( "VAR1 = 0; VAR2= -0; VAR1 += VAR2", 0, VAR1 );
VAR1 = -0; VAR2 = 0; VAR1 += VAR2;
array[item++] = Assert.expectEq( "VAR1 = -0; VAR2= 0; VAR1 += VAR2", 0, VAR1 );
VAR1 = -0; VAR2 = -0; VAR1 += VAR2;
array[item++] = Assert.expectEq( "VAR1 = -0; VAR2= -0; VAR1 += VAR2", -0, VAR1 );
// the sum of a zero and a nonzero finite value is eqal to the nonzero operand
VAR1 = 0; VAR2 = 1; VAR2 += VAR1;
array[item++] = Assert.expectEq( "VAR1 = 0; VAR2= 1; VAR2 += VAR1; VAR2", 1, VAR2 );
VAR1 = -0; VAR2 = 1; VAR2 += VAR1;
array[item++] = Assert.expectEq( "VAR1 = -0; VAR2= 1; VAR2 += VAR1; VAR2", 1, VAR2 );
VAR1 = -0; VAR2 = -1; VAR2 += VAR1;
array[item++] = Assert.expectEq( "VAR1 = -0; VAR2= -1; VAR2 += VAR1; VAR2", -1, VAR2 );
VAR1 = 0; VAR2 = -1; VAR2 += VAR1;
array[item++] = Assert.expectEq( "VAR1 = 0; VAR2= -1; VAR2 += VAR1; VAR2", -1, VAR2 );
// the sum of a zero and a nozero finite value is equal to the nonzero operand.
VAR1 = 0; VAR2=1;
array[item++] = Assert.expectEq( "VAR1 = 0; VAR2=1; VAR1 += VAR2", 1, VAR1 += VAR2 );
VAR1 = 0; VAR2=1; VAR1 += VAR2;
array[item++] = Assert.expectEq( "VAR1 = 0; VAR2=1; VAR1 += VAR2;VAR1", 1, VAR1 );
// the sum of two nonzero finite values of the same magnitude and opposite sign is +0
VAR1 = Number.MAX_VALUE; VAR2= -Number.MAX_VALUE; VAR1 += VAR2;
array[item++] = Assert.expectEq( "VAR1 = Number.MAX_VALUE; VAR2= -Number.MAX_VALUE; VAR1 += VAR2; VAR1", 0, VAR1 );
VAR1 = Number.MIN_VALUE; VAR2= -Number.MIN_VALUE; VAR1 += VAR2;
array[item++] = Assert.expectEq( "VAR1 = Number.MIN_VALUE; VAR2= -Number.MIN_VALUE; VAR1 += VAR2; VAR1", 0, VAR1 );
/*
VAR1 = 10; VAR2 = '0XFF';
array[item++] = Assert.expectEq( "VAR1 = 10; VAR2 = '0XFF', VAR1 += VAR2", 2550, VAR1 += VAR2 );
VAR1 = '0XFF'; VAR2 = 0XA;
array[item++] = Assert.expectEq( "VAR1 = '0xFF'; VAR2 = 0xA, VAR1 += VAR2", 2550, VAR1 += VAR2 );
VAR1 = '10'; VAR2 = '255';
array[item++] = Assert.expectEq( "VAR1 = '10'; VAR2 = '255', VAR1 += VAR2", 2550, VAR1 += VAR2 );
VAR1 = '10'; VAR2 = '0XFF';
array[item++] = Assert.expectEq( "VAR1 = '10'; VAR2 = '0XFF', VAR1 += VAR2", 2550, VAR1 += VAR2 );
VAR1 = '0XFF'; VAR2 = 0XA;
array[item++] = Assert.expectEq( "VAR1 = '0xFF'; VAR2 = 0xA, VAR1 += VAR2", 2550, VAR1 += VAR2 );
// boolean cases
VAR1 = true; VAR2 = false;
array[item++] = Assert.expectEq( "VAR1 = true; VAR2 = false; VAR1 += VAR2", 0, VAR1 += VAR2 );
VAR1 = true; VAR2 = true;
array[item++] = Assert.expectEq( "VAR1 = true; VAR2 = true; VAR1 += VAR2", 1, VAR1 += VAR2 );
// object cases
VAR1 = new Boolean(true); VAR2 = 10; VAR1 += VAR2;
array[item++] = Assert.expectEq( "VAR1 = new Boolean(true); VAR2 = 10; VAR1 += VAR2;VAR1", 10, VAR1 );
VAR1 = new Number(11); VAR2 = 10; VAR1 += VAR2;
array[item++] = Assert.expectEq( "VAR1 = new Number(11); VAR2 = 10; VAR1 += VAR2; VAR1", 110, VAR1 );
VAR1 = new Number(11); VAR2 = new Number(10);
array[item++] = Assert.expectEq( "VAR1 = new Number(11); VAR2 = new Number(10); VAR1 += VAR2", 110, VAR1 += VAR2 );
VAR1 = String('15'); VAR2 = new String('0xF');
array[item++] = Assert.expectEq( "VAR1 = new String('15'); VAR2 = new String('0xF'); VAR1 += VAR2", 255, VAR1 += VAR2 );
*/
return ( array );
}

View File

@ -0,0 +1,13 @@
<flex-config>
<compiler>
<source-path>
<path-element>.</path-element>
<path-element>../../../lib</path-element>
</source-path>
<debug>false</debug>
<omit-trace-statements>false</omit-trace-statements>
<show-actionscript-warnings>false</show-actionscript-warnings>
<strict>false</strict>
</compiler>
<output>test.swf</output>
</flex-config>

View File

@ -0,0 +1,26 @@
VAR1 = NaN; VAR2=1; VAR1 += VAR2 PASSED!
VAR1 = NaN; VAR2=1; VAR1 += VAR2; VAR1 PASSED!
VAR1 = NaN; VAR2=0; VAR1 += VAR2 PASSED!
VAR1 = NaN; VAR2=0; VAR1 += VAR2; VAR1 PASSED!
VAR1 = 0; VAR2=NaN; VAR1 += VAR2 PASSED!
VAR1 = 0; VAR2=NaN; VAR1 += VAR2; VAR1 PASSED!
VAR1 = Infinity; VAR2= Infinity; VAR1 += VAR2; VAR1 PASSED!
VAR1 = Infinity; VAR2= -Infinity; VAR1 += VAR2; VAR1 PASSED!
VAR1 =-Infinity; VAR2= Infinity; VAR1 += VAR2; VAR1 PASSED!
VAR1 =-Infinity; VAR2=-Infinity; VAR1 += VAR2; VAR1 PASSED!
VAR1 = 0; VAR2= Infinity; VAR1 += VAR2;VAR1 PASSED!
VAR1 = -0; VAR2= Infinity; VAR1 += VAR2;VAR1 PASSED!
VAR1 = -0; VAR2= -Infinity; VAR1 += VAR2;VAR1 PASSED!
VAR1 = 0; VAR2= -Infinity; VAR1 += VAR2;VAR1 PASSED!
VAR1 = 0; VAR2= 0; VAR1 += VAR2 PASSED!
VAR1 = 0; VAR2= -0; VAR1 += VAR2 PASSED!
VAR1 = -0; VAR2= 0; VAR1 += VAR2 PASSED!
VAR1 = -0; VAR2= -0; VAR1 += VAR2 PASSED!
VAR1 = 0; VAR2= 1; VAR2 += VAR1; VAR2 PASSED!
VAR1 = -0; VAR2= 1; VAR2 += VAR1; VAR2 PASSED!
VAR1 = -0; VAR2= -1; VAR2 += VAR1; VAR2 PASSED!
VAR1 = 0; VAR2= -1; VAR2 += VAR1; VAR2 PASSED!
VAR1 = 0; VAR2=1; VAR1 += VAR2 PASSED!
VAR1 = 0; VAR2=1; VAR1 += VAR2;VAR1 PASSED!
VAR1 = Number.MAX_VALUE; VAR2= -Number.MAX_VALUE; VAR1 += VAR2; VAR1 PASSED!
VAR1 = Number.MIN_VALUE; VAR2= -Number.MIN_VALUE; VAR1 += VAR2; VAR1 PASSED!

View File

@ -0,0 +1 @@
num_ticks = 1

View File

@ -0,0 +1,117 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
package {
import flash.display.MovieClip; public class Test extends MovieClip {}
}
import com.adobe.test.Assert;
// var SECTION = "11_13_2_5";
// var VERSION = "ECMA_1";
var testcases = getTestCases();
function getTestCases() {
var array = new Array();
var item = 0;
// If either operand is NaN, result is NaN
VAR1 = Number.NaN; VAR2=1;
array[item++] = Assert.expectEq( "VAR1 = NaN; VAR2=1; VAR1 -= VAR2", Number.NaN, VAR1 -= VAR2 );
VAR1 = Number.NaN; VAR2=1; VAR1 -= VAR2;
array[item++] = Assert.expectEq( "VAR1 = NaN; VAR2=1; VAR1 -= VAR2; VAR1", Number.NaN, VAR1 );
VAR1 = Number.NaN; VAR2=0;
array[item++] = Assert.expectEq( "VAR1 = NaN; VAR2=0; VAR1 -= VAR2", Number.NaN, VAR1 -= VAR2 );
VAR1 = Number.NaN; VAR2=0; VAR1 -= VAR2;
array[item++] = Assert.expectEq( "VAR1 = NaN; VAR2=0; VAR1 -= VAR2; VAR1", Number.NaN, VAR1 );
VAR1 = 0; VAR2=Number.NaN;
array[item++] = Assert.expectEq( "VAR1 = 0; VAR2=NaN; VAR1 -= VAR2", Number.NaN, VAR1 -= VAR2 );
VAR1 = 0; VAR2=Number.NaN; VAR1 -= VAR2;
array[item++] = Assert.expectEq( "VAR1 = 0; VAR2=NaN; VAR1 -= VAR2; VAR1", Number.NaN, VAR1 );
// the sum of two Infinities the same sign is the infinity of that sign
// the sum of two Infinities of opposite sign is NaN
VAR1 = Number.POSITIVE_INFINITY; VAR2 = Number.POSITIVE_INFINITY; VAR1 -= VAR2;
array[item++] = Assert.expectEq( "VAR1 = Infinity; VAR2= Infinity; VAR1 -= VAR2; VAR1", Number.NaN, VAR1 );
VAR1 = Number.POSITIVE_INFINITY; VAR2 = Number.NEGATIVE_INFINITY; VAR1 -= VAR2;
array[item++] = Assert.expectEq( "VAR1 = Infinity; VAR2= -Infinity; VAR1 -= VAR2; VAR1", Number.POSITIVE_INFINITY, VAR1 );
VAR1 = Number.NEGATIVE_INFINITY; VAR2 = Number.POSITIVE_INFINITY; VAR1 -= VAR2;
array[item++] = Assert.expectEq( "VAR1 =-Infinity; VAR2= Infinity; VAR1 -= VAR2; VAR1", Number.NEGATIVE_INFINITY, VAR1 );
VAR1 = Number.NEGATIVE_INFINITY; VAR2 = Number.NEGATIVE_INFINITY; VAR1 -= VAR2;
array[item++] = Assert.expectEq( "VAR1 =-Infinity; VAR2=-Infinity; VAR1 -= VAR2; VAR1", Number.NaN, VAR1 );
// the sum of an infinity and a finite value is equal to the infinite operand
VAR1 = 0; VAR2 = Number.POSITIVE_INFINITY; VAR1 -= VAR2;
array[item++] = Assert.expectEq( "VAR1 = 0; VAR2= Infinity; VAR1 -= VAR2;VAR1", Number.NEGATIVE_INFINITY, VAR1 );
VAR1 = -0; VAR2 = Number.POSITIVE_INFINITY; VAR1 -= VAR2;
array[item++] = Assert.expectEq( "VAR1 = -0; VAR2= Infinity; VAR1 -= VAR2;VAR1", Number.NEGATIVE_INFINITY, VAR1 );
VAR1 = 0; VAR2 = Number.NEGATIVE_INFINITY; VAR1 -= VAR2;
array[item++] = Assert.expectEq( "VAR1 = 0; VAR2= -Infinity; VAR1 -= VAR2;VAR1", Number.POSITIVE_INFINITY,VAR1 );
VAR1 = -0; VAR2 = Number.NEGATIVE_INFINITY; VAR1 -= VAR2;
array[item++] = Assert.expectEq( "VAR1 = -0; VAR2= -Infinity; VAR1 -= VAR2;VAR1", Number.POSITIVE_INFINITY, VAR1 );
// the sum of two negative zeros is -0. the sum of two positive zeros, or of two zeros of opposite sign, is +0
VAR1 = 0; VAR2 = 0; VAR1 -= VAR2;
array[item++] = Assert.expectEq( "VAR1 = 0; VAR2= -0; VAR1 -= VAR2", 0, VAR1 );
VAR1 = 0; VAR2 = -0; VAR1 -= VAR2;
array[item++] = Assert.expectEq( "VAR1 = 0; VAR2= 0; VAR1 -= VAR2", 0, VAR1 );
VAR1 = -0; VAR2 = 0; VAR1 -= VAR2;
array[item++] = Assert.expectEq( "VAR1 = -0; VAR2= -0; VAR1 -= VAR2", 0, VAR1 );
VAR1 = -0; VAR2 = -0; VAR1 -= VAR2;
array[item++] = Assert.expectEq( "VAR1 = -0; VAR2= 0; VAR1 -= VAR2", -0, VAR1 );
// the sum of a zero and a nonzero finite value is eqal to the nonzero operand
VAR1 = 0; VAR2 = -1; VAR1 -= VAR2;
array[item++] = Assert.expectEq( "VAR1 = 0; VAR2= -1; VAR1 -= VAR2; VAR1", 1, VAR1 );
VAR1 = -0; VAR2 = -1; VAR1 -= VAR2;
array[item++] = Assert.expectEq( "VAR1 = -0; VAR2= -1; VAR1 -= VAR2; VAR1", 1, VAR1 );
VAR1 = -0; VAR2 = 1; VAR1 -= VAR2;
array[item++] = Assert.expectEq( "VAR1 = -0; VAR2= 1; VAR1 -= VAR2; VAR1", -1, VAR1 );
VAR1 = 0; VAR2 = 1; VAR1 -= VAR2;
array[item++] = Assert.expectEq( "VAR1 = 0; VAR2= 1; VAR1 -= VAR2; VAR1", -1, VAR1 );
// the sum of a zero and a nozero finite value is equal to the nonzero operand.
VAR1 = 0; VAR2=-1; VAR1 -= VAR2;
array[item++] = Assert.expectEq( "VAR1 = 0; VAR2=-1; VAR1 -= VAR2", 1, VAR1 );
VAR1 = 0; VAR2=-1; VAR1 -= VAR2;
array[item++] = Assert.expectEq( "VAR1 = 0; VAR2=-1; VAR1 -= VAR2;VAR1", 1, VAR1 );
// the sum of two nonzero finite values of the same magnitude and opposite sign is +0
VAR1 = Number.MAX_VALUE; VAR2= Number.MAX_VALUE; VAR1 -= VAR2;
array[item++] = Assert.expectEq( "VAR1 = Number.MAX_VALUE; VAR2= Number.MAX_VALUE; VAR1 -= VAR2; VAR1", 0, VAR1 );
VAR1 = Number.MIN_VALUE; VAR2= Number.MIN_VALUE; VAR1 -= VAR2;
array[item++] = Assert.expectEq( "VAR1 = Number.MIN_VALUE; VAR2= Number.MIN_VALUE; VAR1 -= VAR2; VAR1", 0, VAR1 );
/*
VAR1 = 10; VAR2 = '0XFF';
array[item++] = Assert.expectEq( "VAR1 = 10; VAR2 = '0XFF', VAR1 -= VAR2", 2550, VAR1 -= VAR2 );
VAR1 = '0XFF'; VAR2 = 0XA;
array[item++] = Assert.expectEq( "VAR1 = '0xFF'; VAR2 = 0xA, VAR1 -= VAR2", 2550, VAR1 -= VAR2 );
VAR1 = '10'; VAR2 = '255';
array[item++] = Assert.expectEq( "VAR1 = '10'; VAR2 = '255', VAR1 -= VAR2", 2550, VAR1 -= VAR2 );
VAR1 = '10'; VAR2 = '0XFF';
array[item++] = new TestCas( SECTION, "VAR1 = '10'; VAR2 = '0XFF', VAR1 -= VAR2", 2550, VAR1 -= VAR2 );
VAR1 = '0XFF'; VAR2 = 0XA;
array[item++] = Assert.expectEq( "VAR1 = '0xFF'; VAR2 = 0xA, VAR1 -= VAR2", 2550, VAR1 -= VAR2 );
// boolean cases
VAR1 = true; VAR2 = false;
array[item++] = Assert.expectEq( "VAR1 = true; VAR2 = false; VAR1 -= VAR2", 0, VAR1 -= VAR2 );
VAR1 = true; VAR2 = true;
array[item++] = Assert.expectEq( "VAR1 = true; VAR2 = true; VAR1 -= VAR2", 1, VAR1 -= VAR2 );
// object cases
VAR1 = new Boolean(true); VAR2 = 10; VAR1 -= VAR2;
array[item++] = Assert.expectEq( "VAR1 = new Boolean(true); VAR2 = 10; VAR1 -= VAR2;VAR1", 10, VAR1 );
VAR1 = new Number(11); VAR2 = 10; VAR1 -= VAR2;
array[item++] = Assert.expectEq( "VAR1 = new Number(11); VAR2 = 10; VAR1 -= VAR2; VAR1", 110, VAR1 );
VAR1 = new Number(11); VAR2 = new Number(10);
array[item++] = Assert.expectEq( "VAR1 = new Number(11); VAR2 = new Number(10); VAR1 -= VAR2", 110, VAR1 -= VAR2 );
VAR1 = String('15'); VAR2 = new String('0xF');
array[item++] = Assert.expectEq( "VAR1 = new String('15'); VAR2 = new String('0xF'); VAR1 -= VAR2", 255, VAR1 -= VAR2 );
*/
return ( array );
}

View File

@ -0,0 +1,13 @@
<flex-config>
<compiler>
<source-path>
<path-element>.</path-element>
<path-element>../../../lib</path-element>
</source-path>
<debug>false</debug>
<omit-trace-statements>false</omit-trace-statements>
<show-actionscript-warnings>false</show-actionscript-warnings>
<strict>false</strict>
</compiler>
<output>test.swf</output>
</flex-config>

View File

@ -0,0 +1,26 @@
VAR1 = NaN; VAR2=1; VAR1 -= VAR2 PASSED!
VAR1 = NaN; VAR2=1; VAR1 -= VAR2; VAR1 PASSED!
VAR1 = NaN; VAR2=0; VAR1 -= VAR2 PASSED!
VAR1 = NaN; VAR2=0; VAR1 -= VAR2; VAR1 PASSED!
VAR1 = 0; VAR2=NaN; VAR1 -= VAR2 PASSED!
VAR1 = 0; VAR2=NaN; VAR1 -= VAR2; VAR1 PASSED!
VAR1 = Infinity; VAR2= Infinity; VAR1 -= VAR2; VAR1 PASSED!
VAR1 = Infinity; VAR2= -Infinity; VAR1 -= VAR2; VAR1 PASSED!
VAR1 =-Infinity; VAR2= Infinity; VAR1 -= VAR2; VAR1 PASSED!
VAR1 =-Infinity; VAR2=-Infinity; VAR1 -= VAR2; VAR1 PASSED!
VAR1 = 0; VAR2= Infinity; VAR1 -= VAR2;VAR1 PASSED!
VAR1 = -0; VAR2= Infinity; VAR1 -= VAR2;VAR1 PASSED!
VAR1 = 0; VAR2= -Infinity; VAR1 -= VAR2;VAR1 PASSED!
VAR1 = -0; VAR2= -Infinity; VAR1 -= VAR2;VAR1 PASSED!
VAR1 = 0; VAR2= -0; VAR1 -= VAR2 PASSED!
VAR1 = 0; VAR2= 0; VAR1 -= VAR2 PASSED!
VAR1 = -0; VAR2= -0; VAR1 -= VAR2 PASSED!
VAR1 = -0; VAR2= 0; VAR1 -= VAR2 PASSED!
VAR1 = 0; VAR2= -1; VAR1 -= VAR2; VAR1 PASSED!
VAR1 = -0; VAR2= -1; VAR1 -= VAR2; VAR1 PASSED!
VAR1 = -0; VAR2= 1; VAR1 -= VAR2; VAR1 PASSED!
VAR1 = 0; VAR2= 1; VAR1 -= VAR2; VAR1 PASSED!
VAR1 = 0; VAR2=-1; VAR1 -= VAR2 PASSED!
VAR1 = 0; VAR2=-1; VAR1 -= VAR2;VAR1 PASSED!
VAR1 = Number.MAX_VALUE; VAR2= Number.MAX_VALUE; VAR1 -= VAR2; VAR1 PASSED!
VAR1 = Number.MIN_VALUE; VAR2= Number.MIN_VALUE; VAR1 -= VAR2; VAR1 PASSED!

View File

@ -0,0 +1 @@
num_ticks = 1

View File

@ -0,0 +1,22 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
package {
import flash.display.MovieClip; public class Test extends MovieClip {}
}
import com.adobe.test.Assert;
// var SECTION = "e11_14_1";
// var VERSION = "ECMA_1";
var testcases = getTestCases();
function getTestCases() {
var array = new Array();
var item = 0;
array[item++] = Assert.expectEq( "true, false", false, (true, false) );
array[item++] = Assert.expectEq( "VAR1=true, VAR2=false", false, (VAR1=true, VAR2=false) );
array[item++] = Assert.expectEq( "VAR1=true, VAR2=false;VAR1", true, (VAR1=true, VAR2=false, VAR1) );
return ( array );
}

View File

@ -0,0 +1,13 @@
<flex-config>
<compiler>
<source-path>
<path-element>.</path-element>
<path-element>../../../lib</path-element>
</source-path>
<debug>false</debug>
<omit-trace-statements>false</omit-trace-statements>
<show-actionscript-warnings>false</show-actionscript-warnings>
<strict>false</strict>
</compiler>
<output>test.swf</output>
</flex-config>

View File

@ -0,0 +1,3 @@
true, false PASSED!
VAR1=true, VAR2=false PASSED!
VAR1=true, VAR2=false;VAR1 PASSED!

View File

@ -0,0 +1 @@
num_ticks = 1

View File

@ -0,0 +1,77 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
package {
import flash.display.MovieClip; public class Test extends MovieClip {}
}
import com.adobe.test.Assert;
// var SECTION = "11.1.1";
// var VERSION = "ECMA_1";
var testcases = getTestCases();
function getTestCases(){
var array = new Array();
var item = 0;
var GLOBAL_OBJECT = this.toString();
// this in global code should return the global object.
array[item++] = Assert.expectEq(
"Global Code: this.toString()",
GLOBAL_OBJECT,
this.toString() );
// this in anonymous code called as a function should return the global object.
// will work in spidermonkey but will fail in FP7, no compiler error
var MYFUNC = function(){return this.toString()}
array[item++] = Assert.expectEq(
"Anonymous Code: var MYFUNC = new Function('return this.toString()'); MYFUNC()",
GLOBAL_OBJECT,
MYFUNC() );
// thisin anonymous code called as a function should return that function's activation object
var MYFUNC = function(){return this.toString();}
array[item++] = Assert.expectEq(
"Anonymous Code: var MYFUNC = function(){return this.toString;}",
GLOBAL_OBJECT,
(MYFUNC()).toString() );
// this in anonymous code called as a constructor should return the object
var MYFUNC = function(){this.THIS = this}
array[item++] = Assert.expectEq(
"Anonymous Code: var MYFUNC = new Function('this.THIS = this'); ((new MYFUNC()).THIS).toString()",
"[object Object]",
((new MYFUNC()).THIS).toString() );
var MYFUNC = function(){this.THIS = this}
var FUN1 = new MYFUNC();
array[item++] = Assert.expectEq(
"Anonymous Code: var MYFUNC = new Function('this.THIS = this'); var FUN1 = new MYFUNC(); FUN1.THIS == FUN1",
true,
FUN1.THIS == FUN1 );
// this in function code called as a function should return the global object.
array[item++] = Assert.expectEq(
"Function Code: ReturnThis()",
GLOBAL_OBJECT,
ReturnThis() );
// this in function code called as a contructor should return the object.
var MYOBJECT = new ReturnThis();
array[item++] = Assert.expectEq(
"var MYOBJECT = new ReturnThis(); MYOBJECT.toString()",
"[object Object]",
MYOBJECT.toString() );
return array;
}
function ReturnThis() {
return this.toString();
}

View File

@ -0,0 +1,13 @@
<flex-config>
<compiler>
<source-path>
<path-element>.</path-element>
<path-element>../../../lib</path-element>
</source-path>
<debug>false</debug>
<omit-trace-statements>false</omit-trace-statements>
<show-actionscript-warnings>false</show-actionscript-warnings>
<strict>false</strict>
</compiler>
<output>test.swf</output>
</flex-config>

View File

@ -0,0 +1,7 @@
Global Code: this.toString() PASSED!
Anonymous Code: var MYFUNC = new Function('return this.toString()'); MYFUNC() PASSED!
Anonymous Code: var MYFUNC = function(){return this.toString;} PASSED!
Anonymous Code: var MYFUNC = new Function('this.THIS = this'); ((new MYFUNC()).THIS).toString() PASSED!
Anonymous Code: var MYFUNC = new Function('this.THIS = this'); var FUN1 = new MYFUNC(); FUN1.THIS == FUN1 PASSED!
Function Code: ReturnThis() PASSED!
var MYOBJECT = new ReturnThis(); MYOBJECT.toString() PASSED!

View File

@ -0,0 +1 @@
num_ticks = 1

View File

@ -0,0 +1,201 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
package {
import flash.display.MovieClip; public class Test extends MovieClip {}
}
import com.adobe.test.Assert;
// var SECTION = "11.1.4";
// var VERSION = "ECMA_1";
// var TITLE = "Array Initialiser";
var testcases = getTestCases();
function getTestCases() {
var array = new Array();
var item = 0;
Array_One = []
array[item++] = Assert.expectEq(
"typeof Array_One",
"object",
typeof Array_One );
array[item++] = Assert.expectEq(
"Array_One=[]; Array_One.getClass = Object.prototype.toString; Array_One.getClass()",
"[object Array]",
(Array_One.getClass = Object.prototype.toString, Array_One.getClass() ) );
array[item++] = Assert.expectEq(
"Array_One = []; Array_One.toString == Array.prototype.toString",
true,
(Array_One.toString == Array.prototype.toString ) );
array[item++] = Assert.expectEq(
"Array_One.length",
0,
Array_One.length );
Array_Two = [1,2,3]
array[item++] = Assert.expectEq(
"Array_Two",
"1,2,3",
Array_Two+"" );
array[item++] = Assert.expectEq(
"typeof Array_Two",
"object",
typeof Array_Two);
array[item++] = Assert.expectEq(
"Array_Two=[1,2,3]; arr.getClass = Object.prototype.toString; arr.getClass()",
"[object Array]",
(Array_Two.getClass = Object.prototype.toString, Array_Two.getClass() ) );
array[item++] = Assert.expectEq(
"Array_Two.toString == Array.prototype.toString",
true,
(Array_Two.toString == Array.prototype.toString ) );
array[item++] = Assert.expectEq(
"Array_Two.length",
3,
Array_Two.length );
Array_Three = [12345]
array[item++] = Assert.expectEq(
"typeof Array_Three",
"object",
typeof Array_Three );
array[item++] = Assert.expectEq(
"Array_Three=[12345]; Array_Three.getClass = Object.prototype.toString; Array_Three.getClass()",
"[object Array]",
(Array_Three.getClass = Object.prototype.toString, Array_Three.getClass() ) );
Array_Four = [1,2,3,4,5]
array[item++] = Assert.expectEq(
"Array_Four.toString == Array.prototype.toString",
true,
(Array_Four.toString == Array.prototype.toString ) );
Array_Five = [,2,3,4,5]
array[item++] = Assert.expectEq(
"Array_Five.length",
5,
Array_Five.length );
array[item++] = Assert.expectEq(
"Array_Five[1]",
2,
Array_Five[1] );
Array_Six = [1,2,3,4,5,6,7,8,9,10,11,12,13,,15,16,17,18,19,20,21,22,23,24,25]
array[item++] = Assert.expectEq(
"Array_Six.length",
25,
Array_Six.length );
array[item++] = Assert.expectEq(
"Array_Six[14]",
15,
Array_Six[14] );
Array_Seven = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,]
array[item++] = Assert.expectEq(
"Array_Seven.length",
32,
Array_Seven.length );
Array_Eight=[,,,,,,,,,,,,,,,]
array[item++] = Assert.expectEq(
"Array_Eight.length",
15,
Array_Eight.length );
Array_Nine = [,2,3,4,5,6,7,8,9,10,11,,13,14,15,16,17,18,19,,21,22,23,24,25,26,27,28,29,30,31,32,]
array[item++] = Assert.expectEq(
"Array_Nine.length",
32,
Array_Nine.length );
array[item++] = Assert.expectEq(
"Array_Nine[1]",
2,
Array_Nine[1] );
array[item++] = Assert.expectEq(
"Array_Nine[0]",
undefined,
Array_Nine[0] );
array[item++] = Assert.expectEq(
"Array_Nine[11]",
undefined,
Array_Nine[11] );
array[item++] = Assert.expectEq(
"Array_Nine[12]",
13,
Array_Nine[12] );
array[item++] = Assert.expectEq(
"Array_Nine[19]",
undefined,
Array_Nine[19] );
array[item++] = Assert.expectEq(
"Array_Nine[20]",
21,
Array_Nine[20] );
array[item++] = Assert.expectEq(
"Array_Nine[32]",
undefined,
Array_Nine[32] );
var Array_Ten:Array = [[1, 2, 3], [4, 5, 6], [7, 8, 9]];
array[item++] = Assert.expectEq(
"Multi dimensional array",
6,
Array_Ten[1][2] );
var obj = new Object();
obj.prop1 = "Good";
obj.prop2 = "one";
for (j in obj){
var myvar = obj[j];
if (myvar=="one"){
break;
}
//print(myvar);
}
array[item++] = Assert.expectEq( "Using array initializers to dynamically set and retrieve values of an object","one",myvar );
return ( array );
}

View File

@ -0,0 +1,13 @@
<flex-config>
<compiler>
<source-path>
<path-element>.</path-element>
<path-element>../../../lib</path-element>
</source-path>
<debug>false</debug>
<omit-trace-statements>false</omit-trace-statements>
<show-actionscript-warnings>false</show-actionscript-warnings>
<strict>false</strict>
</compiler>
<output>test.swf</output>
</flex-config>

View File

@ -0,0 +1,28 @@
typeof Array_One PASSED!
Array_One=[]; Array_One.getClass = Object.prototype.toString; Array_One.getClass() PASSED!
Array_One = []; Array_One.toString == Array.prototype.toString PASSED!
Array_One.length PASSED!
Array_Two PASSED!
typeof Array_Two PASSED!
Array_Two=[1,2,3]; arr.getClass = Object.prototype.toString; arr.getClass() PASSED!
Array_Two.toString == Array.prototype.toString PASSED!
Array_Two.length PASSED!
typeof Array_Three PASSED!
Array_Three=[12345]; Array_Three.getClass = Object.prototype.toString; Array_Three.getClass() PASSED!
Array_Four.toString == Array.prototype.toString PASSED!
Array_Five.length PASSED!
Array_Five[1] PASSED!
Array_Six.length PASSED!
Array_Six[14] PASSED!
Array_Seven.length PASSED!
Array_Eight.length PASSED!
Array_Nine.length PASSED!
Array_Nine[1] PASSED!
Array_Nine[0] PASSED!
Array_Nine[11] PASSED!
Array_Nine[12] PASSED!
Array_Nine[19] PASSED!
Array_Nine[20] PASSED!
Array_Nine[32] PASSED!
Multi dimensional array PASSED!
Using array initializers to dynamically set and retrieve values of an object PASSED!

View File

@ -0,0 +1,2 @@
num_ticks = 1
known_failure = true

View File

@ -0,0 +1,94 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
package {
import flash.display.MovieClip; public class Test extends MovieClip {}
}
import com.adobe.test.Assert;
// var SECTION = "11.1.5";
// var VERSION = "ECMA_4";
// var TITLE = "Object Initialisers";
var testcases = getTestCases();
function getTestCases() {
var array = new Array();
var item = 0;
MyObject = {}
array[item++] = Assert.expectEq( "MyObject = {}", "[object Object]", MyObject.toString() );
array[item++] = Assert.expectEq( "MyObject = {}, typeof MyObject","object",typeof MyObject );
MyNumberObject = {MyNumber:10}
array[item++] = Assert.expectEq( "MyNumberObject = {MyNumber:10}",10,MyNumberObject.MyNumber );
MyStringObject = {MyString:"string"}
array[item++] = Assert.expectEq( "MyStringObject = {MyString:string}","string",MyStringObject.MyString );
MyBooleanObject = {MyBoolean:true}
array[item++] = Assert.expectEq( "MyBooleanObject = {MyBoolean:true}",true,MyBooleanObject.MyBoolean );
function myfunc():String{
return "Hi!!!"}
MyObject2 = {MyNumber:10,MyString:'string',MyBoolean:true,myarr:[1,2,3],myfuncvar:myfunc}
array[item++] = Assert.expectEq( "MyObject2 = {MyNumber:10,MyString:'string',MyBoolean:true,myarr:[1,2,3],myfuncvar:myfunc}",10,MyObject2.MyNumber );
array[item++] = Assert.expectEq( "MyObject2 = {MyNumber:10,MyString:'string',MyBoolean:true,myarr:[1,2,3],myfuncvar:myfunc}","string",MyObject2.MyString );
array[item++] = Assert.expectEq( "MyObject2 = {MyNumber:10,MyString:'string',MyBoolean:true,myarr:[1,2,3],myfuncvar:myfunc}",true,MyObject2.MyBoolean );
array[item++] = Assert.expectEq( "MyObject2 = {MyNumber:10,MyString:'string',MyBoolean:true,myarr:[1,2,3],myfuncvar:myfunc}","number",typeof MyObject2.MyNumber );
array[item++] = Assert.expectEq( "MyObject2 = {MyNumber:10,MyString:'string',MyBoolean:true,myarr:[1,2,3],myfuncvar:myfunc}","string",typeof MyObject2.MyString );
array[item++] = Assert.expectEq( "MyObject2 = {MyNumber:10,MyString:'string',MyBoolean:true,myarr:[1,2,3],myfuncvar:myfunc}","boolean",typeof MyObject2.MyBoolean );
array[item++] = Assert.expectEq( "MyObject2 = {MyNumber:10,MyString:'string',MyBoolean:true,myarr:[1,2,3],myfuncvar:myfunc}",3,MyObject2.myarr.length );
array[item++] = Assert.expectEq( "MyObject2 = {MyNumber:10,MyString:'string',MyBoolean:true,myarr:[1,2,3],myfuncvar:myfunc}","object",typeof MyObject2.myarr );
array[item++] = Assert.expectEq( "MyObject2 = {MyNumber:10,MyString:'string',MyBoolean:true,myarr:[1,2,3],myfuncvar:myfunc}","Hi!!!",MyObject2.myfuncvar() );
array[item++] = Assert.expectEq( "MyObject2 = {MyNumber:10,MyString:'string',MyBoolean:true,myarr:[1,2,3],myfuncvar:myfunc}","function",typeof MyObject2.myfuncvar );
MyObject3 = {myvar:this}
array[item++] = Assert.expectEq( "MyObject3 = {this}","object",typeof MyObject3.myvar);
array[item++] = Assert.expectEq( "MyObject3 = {this}","[object global]",MyObject3.myvar+"");
MyObject4 = {myvar:function() {}}
array[item++] = Assert.expectEq( "MyObject4 = {myvar:function() {}}","function",typeof MyObject4.myvar);
array[item++] = Assert.expectEq( "MyObject4 = {myvar:function() {}}","function Function() {}",MyObject4.myvar+"");
array[item++] = Assert.expectEq( "MyObject4 = {myvar:function() {}}","function Function() {}",MyObject4.myvar.toString());
return ( array );
}
function MyObject( value ) {
this.value = function() {return this.value;}
this.toString = function() {return this.value+'';}
}

View File

@ -0,0 +1,13 @@
<flex-config>
<compiler>
<source-path>
<path-element>.</path-element>
<path-element>../../../lib</path-element>
</source-path>
<debug>false</debug>
<omit-trace-statements>false</omit-trace-statements>
<show-actionscript-warnings>false</show-actionscript-warnings>
<strict>false</strict>
</compiler>
<output>test.swf</output>
</flex-config>

View File

@ -0,0 +1,20 @@
MyObject = {} PASSED!
MyObject = {}, typeof MyObject PASSED!
MyNumberObject = {MyNumber:10} PASSED!
MyStringObject = {MyString:string} PASSED!
MyBooleanObject = {MyBoolean:true} PASSED!
MyObject2 = {MyNumber:10,MyString:'string',MyBoolean:true,myarr:[1,2,3],myfuncvar:myfunc} PASSED!
MyObject2 = {MyNumber:10,MyString:'string',MyBoolean:true,myarr:[1,2,3],myfuncvar:myfunc} PASSED!
MyObject2 = {MyNumber:10,MyString:'string',MyBoolean:true,myarr:[1,2,3],myfuncvar:myfunc} PASSED!
MyObject2 = {MyNumber:10,MyString:'string',MyBoolean:true,myarr:[1,2,3],myfuncvar:myfunc} PASSED!
MyObject2 = {MyNumber:10,MyString:'string',MyBoolean:true,myarr:[1,2,3],myfuncvar:myfunc} PASSED!
MyObject2 = {MyNumber:10,MyString:'string',MyBoolean:true,myarr:[1,2,3],myfuncvar:myfunc} PASSED!
MyObject2 = {MyNumber:10,MyString:'string',MyBoolean:true,myarr:[1,2,3],myfuncvar:myfunc} PASSED!
MyObject2 = {MyNumber:10,MyString:'string',MyBoolean:true,myarr:[1,2,3],myfuncvar:myfunc} PASSED!
MyObject2 = {MyNumber:10,MyString:'string',MyBoolean:true,myarr:[1,2,3],myfuncvar:myfunc} PASSED!
MyObject2 = {MyNumber:10,MyString:'string',MyBoolean:true,myarr:[1,2,3],myfuncvar:myfunc} PASSED!
MyObject3 = {this} PASSED!
MyObject3 = {this} PASSED!
MyObject4 = {myvar:function() {}} PASSED!
MyObject4 = {myvar:function() {}} PASSED!
MyObject4 = {myvar:function() {}} PASSED!

View File

@ -0,0 +1 @@
num_ticks = 1

View File

@ -0,0 +1,125 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
package {
import flash.display.MovieClip; public class Test extends MovieClip {}
}
import com.adobe.test.Assert;
// var SECTION = "11.1.6";
// var VERSION = "ECMA_4";
// var TITLE = "The Grouping Operator";
var testcases = getTestCases();
function getTestCases() {
var array = new Array();
var item = 0;
array[item++] = Assert.expectEq( "typeof(new Object())","object",typeof(new Object()));
array[item++] = Assert.expectEq( "typeof(new Array())","object",typeof(new Array()));
array[item++] = Assert.expectEq( "typeof(new Date())","object",typeof(new Date()));
array[item++] = Assert.expectEq( "typeof(new Boolean())","boolean",typeof(new Boolean()));
array[item++] = Assert.expectEq( "typeof(new String())","string",typeof(new String()));
array[item++] = Assert.expectEq( "typeof(new Number())","number",typeof(new Number()));
array[item++] = Assert.expectEq( "typeof(Math)","object",typeof(Math));
array[item++] = Assert.expectEq( "typeof(function(){})","function",typeof(function(){}));
array[item++] = Assert.expectEq( "typeof(this)","object",typeof(this));
var MyVar:Number=10;
array[item++] = Assert.expectEq( "typeof(MyVar)","number",typeof(MyVar));
array[item++] = Assert.expectEq( "typeof([])","object",typeof([]));
array[item++] = Assert.expectEq( "typeof({})","object",typeof({}));
array[item++] = Assert.expectEq( "typeof('')","string",typeof(''));
var MyArray = new Array(1,2,3);
delete(MyArray[0])
array[item++] = Assert.expectEq( "delete(MyArray[0]);MyArray[0]",undefined,MyArray[0]);
Number.prototype.foo=10;
delete(Number.prototype.foo);
array[item++] = Assert.expectEq( "delete(Number.prototype.foo);",undefined,Number.prototype.foo);
String.prototype.goo = 'hi';
delete(String.prototype.goo);
array[item++] = Assert.expectEq( "delete(String.prototype.goo);",undefined,String.prototype.goo);
Date.prototype.mydate=new Date(0);
delete(Date.prototype.mydate);
array[item++] = Assert.expectEq( "delete(Date.prototype.mydate);",undefined,Date.prototype.mydate);
array[item++] = Assert.expectEq( "delete(new String('hi'));",true,delete(new String('hi')));
array[item++] = Assert.expectEq( "delete(new Date(0));",true,delete(new Date(0)));
array[item++] = Assert.expectEq( "delete(new Number(10));",true,delete(new Number(10)));
array[item++] = Assert.expectEq( "delete(new Object());",true,delete(new Object()));
var obj = new Object();
array[item++] = Assert.expectEq( "delete(obj) Trying to delete an object of reference type should return false",false,delete(obj));
var a:Number = 10;
var b:Number = 20;
var c:Number = 30;
var d:Number = 40;
/*Grouping operators are used to change the normal hierarchy of the mathematical operators, expressions inside paranthesis are calculated first before any other expressions are calculated*/
array[item++] = Assert.expectEq( "Grouping operator used in defining the hierarchy of the operators",true,(a+b*c+d)!=((a+b)*(c+d)));
//Grouping operators are used when passing parameters through a function
function myfunction(a):Number{
return a*a;
}
array[item++] = Assert.expectEq( "Grouping operator used in passing parameters to a function",4,myfunction(2));
var a:Number = 1;
var b:Number = 2;
function foo() { a += b; }
function bar() { b *= 10; }
array[item++] = Assert.expectEq( "Grouping operator used in evaluating functions and returning the results of an expression",23,(foo(), bar(), a + b));
return ( array );
}
function MyObject( value ) {
this.value = function() {return this.value;}
this.toString = function() {return this.value+'';}
}

View File

@ -0,0 +1,13 @@
<flex-config>
<compiler>
<source-path>
<path-element>.</path-element>
<path-element>../../../lib</path-element>
</source-path>
<debug>false</debug>
<omit-trace-statements>false</omit-trace-statements>
<show-actionscript-warnings>false</show-actionscript-warnings>
<strict>false</strict>
</compiler>
<output>test.swf</output>
</flex-config>

View File

@ -0,0 +1,25 @@
typeof(new Object()) PASSED!
typeof(new Array()) PASSED!
typeof(new Date()) PASSED!
typeof(new Boolean()) PASSED!
typeof(new String()) PASSED!
typeof(new Number()) PASSED!
typeof(Math) PASSED!
typeof(function(){}) PASSED!
typeof(this) PASSED!
typeof(MyVar) PASSED!
typeof([]) PASSED!
typeof({}) PASSED!
typeof('') PASSED!
delete(MyArray[0]);MyArray[0] PASSED!
delete(Number.prototype.foo); PASSED!
delete(String.prototype.goo); PASSED!
delete(Date.prototype.mydate); PASSED!
delete(new String('hi')); PASSED!
delete(new Date(0)); PASSED!
delete(new Number(10)); PASSED!
delete(new Object()); PASSED!
delete(obj) Trying to delete an object of reference type should return false PASSED!
Grouping operator used in defining the hierarchy of the operators PASSED!
Grouping operator used in passing parameters to a function PASSED!
Grouping operator used in evaluating functions and returning the results of an expression PASSED!

View File

@ -0,0 +1 @@
num_ticks = 1

Some files were not shown because too many files have changed in this diff Show More