aboutsummaryrefslogtreecommitdiffstats
path: root/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21
diff options
context:
space:
mode:
Diffstat (limited to 'external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21')
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-0-1.js36
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-0-2.js39
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-1-1.js44
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-1-10.js51
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-1-11.js47
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-1-12.js47
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-1-13.js51
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-1-14.js47
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-1-15.js48
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-1-2.js44
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-1-3.js53
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-1-4.js48
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-1-5.js51
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-1-6.js47
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-1-7.js44
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-1-8.js46
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-1-9.js49
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-10-1.js51
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-10-2.js46
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-10-3.js42
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-10-4.js42
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-10-5.js46
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-10-6.js42
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-10-7.js42
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-10-8.js52
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-2-1.js51
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-2-10.js61
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-2-11.js54
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-2-12.js63
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-2-13.js59
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-2-14.js49
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-2-15.js56
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-2-17.js49
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-2-18.js46
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-2-19.js51
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-2-2.js44
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-2-3.js55
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-2-4.js52
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-2-5.js65
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-2-6.js54
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-2-7.js57
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-2-8.js62
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-2-9.js69
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-1.js49
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-10.js49
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-11.js46
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-12.js46
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-13.js46
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-14.js66
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-15.js46
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-16.js46
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-17.js46
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-18.js48
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-19.js54
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-2.js47
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-20.js54
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-21.js62
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-22.js70
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-23.js70
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-24.js49
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-25.js50
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-28.js52
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-29.js50
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-3.js49
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-4.js49
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-5.js49
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-6.js46
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-7.js46
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-8.js49
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-9.js48
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-4-1.js45
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-4-10.js54
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-4-11.js58
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-4-12.js46
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-4-15.js64
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-4-2.js45
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-4-3.js45
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-4-4.js45
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-4-5.js45
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-4-6.js45
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-4-7.js45
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-4-8.js57
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-4-9.js61
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-5-1.js46
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-5-10.js61
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-5-11.js65
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-5-12.js58
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-5-13.js63
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-5-2.js50
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-5-3.js50
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-5-4.js50
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-5-5.js50
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-5-6.js52
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-5-7.js58
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-5-8.js65
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-5-9.js45
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-7-1.js42
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-7-10.js41
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-7-11.js41
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-7-2.js46
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-7-3.js46
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-7-4.js46
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-7-5.js46
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-7-6.js48
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-7-7.js54
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-7-8.js61
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-7-9.js61
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-1.js57
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-2.js54
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-3.js71
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-ii-1.js49
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-ii-2.js50
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-1.js47
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-10.js57
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-11.js63
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-12.js62
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-13.js69
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-14.js67
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-15.js63
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-16.js60
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-17.js55
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-18.js55
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-19.js61
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-2.js48
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-20.js60
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-21.js60
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-22.js61
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-23.js61
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-25.js52
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-26.js53
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-27.js54
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-28.js50
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-29.js57
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-3.js57
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-30.js70
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-31.js71
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-32.js62
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-33.js63
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-4.js54
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-5.js68
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-6.js59
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-7.js55
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-8.js57
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-9.js56
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-c-1.js48
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-c-2.js50
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-c-3.js53
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-c-4.js50
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-c-5.js56
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-c-6.js61
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-c-7.js53
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-c-8.js58
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-1.js43
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-10.js44
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-2.js47
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-3.js47
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-4.js46
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-5.js46
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-6.js51
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-7.js43
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-8.js57
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-9.js56
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-1.js45
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-10.js65
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-11.js64
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-12.js63
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-13.js62
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-14.js61
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-15.js69
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-16.js66
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-17.js63
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-18.js63
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-19.js67
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-2.js59
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-20.js67
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-21.js67
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-22.js67
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-23.js65
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-24.js64
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-25.js63
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-26.js62
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-27.js61
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-28.js69
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-29.js66
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-3.js61
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-4.js63
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-5.js63
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-6.js67
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-7.js67
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-8.js67
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-9.js60
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-1.js47
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-1.js48
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-10.js58
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-11.js64
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-12.js64
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-13.js70
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-14.js69
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-15.js64
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-16.js62
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-17.js56
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-18.js57
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-19.js67
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-2.js49
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-20.js67
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-21.js61
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-22.js61
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-23.js60
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-25.js53
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-26.js53
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-27.js53
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-28.js52
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-29.js57
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-3.js58
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-30.js71
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-31.js72
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-32.js63
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-33.js64
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-4.js54
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-5.js71
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-6.js61
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-7.js56
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-8.js59
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-9.js58
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-1.js47
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-10.js46
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-11.js46
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-12.js46
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-13.js46
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-14.js46
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-16.js58
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-17.js53
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-18.js50
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-19.js50
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-2.js51
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-20.js48
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-21.js48
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-22.js48
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-23.js48
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-24.js48
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-25.js50
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-26.js50
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-27.js50
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-28.js50
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-29.js50
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-3.js48
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-30.js48
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-31.js50
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-32.js50
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-33.js48
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-34.js50
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-35.js54
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-37.js48
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-4-s.js48
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-4.js55
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-5.js62
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-7.js58
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-8.js54
-rw-r--r--external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-9.js46
259 files changed, 14084 insertions, 0 deletions
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-0-1.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-0-1.js
new file mode 100644
index 000000000..fb19acb43
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-0-1.js
@@ -0,0 +1,36 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest( {
+id: "15.4.4.21-0-1",
+
+path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-0-1.js",
+
+description: "Array.prototype.reduce must exist as a function",
+
+test: function testcase() {
+ var f = Array.prototype.reduce;
+ if (typeof(f) === "function") {
+ return true;
+ }
+ }
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-0-2.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-0-2.js
new file mode 100644
index 000000000..9cb0ae364
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-0-2.js
@@ -0,0 +1,39 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest( {
+id: "15.4.4.21-0-2",
+
+path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-0-2.js",
+
+description: "Array.prototype.reduce.length must be 1",
+
+test: function testcase() {
+ if (Array.prototype.reduce.length === 1) {
+ return true;
+ }
+ },
+
+precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-1-1.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-1-1.js
new file mode 100644
index 000000000..e3f3c8bf6
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-1-1.js
@@ -0,0 +1,44 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-1-1",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-1-1.js",
+
+ description: "Array.prototype.reduce applied to undefined",
+
+ test: function testcase() {
+ try {
+ Array.prototype.reduce.call(undefined);
+ return false;
+ } catch (e) {
+ return (e instanceof TypeError);
+ }
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-1-10.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-1-10.js
new file mode 100644
index 000000000..f0511d952
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-1-10.js
@@ -0,0 +1,51 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-1-10",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-1-10.js",
+
+ description: "Array.prototype.reduce applied to the Math object",
+
+ test: function testcase() {
+
+ function callbackfn(prevVal, curVal, idx, obj) {
+ return ('[object Math]' === Object.prototype.toString.call(obj));
+ }
+
+ try {
+ Math.length = 1;
+ Math[0] = 1;
+ return Array.prototype.reduce.call(Math, callbackfn, 1);
+ } finally {
+ delete Math[0];
+ delete Math.length;
+ }
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-1-11.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-1-11.js
new file mode 100644
index 000000000..81bbc11bd
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-1-11.js
@@ -0,0 +1,47 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-1-11",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-1-11.js",
+
+ description: "Array.prototype.reduce applied to Date object",
+
+ test: function testcase() {
+ function callbackfn(prevVal, curVal, idx, obj) {
+ return obj instanceof Date;
+ }
+
+ var obj = new Date();
+ obj.length = 1;
+ obj[0] = 1;
+
+ return Array.prototype.reduce.call(obj, callbackfn, 1);
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-1-12.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-1-12.js
new file mode 100644
index 000000000..1c0903863
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-1-12.js
@@ -0,0 +1,47 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-1-12",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-1-12.js",
+
+ description: "Array.prototype.reduce applied to RegExp object",
+
+ test: function testcase() {
+ function callbackfn(prevVal, curVal, idx, obj) {
+ return obj instanceof RegExp;
+ }
+
+ var obj = new RegExp();
+ obj.length = 1;
+ obj[0] = 1;
+
+ return Array.prototype.reduce.call(obj, callbackfn, 1);
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-1-13.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-1-13.js
new file mode 100644
index 000000000..cd0f3fa33
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-1-13.js
@@ -0,0 +1,51 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-1-13",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-1-13.js",
+
+ description: "Array.prototype.reduce applied to the JSON object",
+
+ test: function testcase() {
+
+ function callbackfn(prevVal, curVal, idx, obj) {
+ return ('[object JSON]' === Object.prototype.toString.call(obj));
+ }
+
+ try {
+ JSON.length = 1;
+ JSON[0] = 1;
+ return Array.prototype.reduce.call(JSON, callbackfn, 1);
+ } finally {
+ delete JSON.length;
+ delete JSON[0];
+ }
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-1-14.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-1-14.js
new file mode 100644
index 000000000..9e3f160dc
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-1-14.js
@@ -0,0 +1,47 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-1-14",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-1-14.js",
+
+ description: "Array.prototype.reduce applied to Error object",
+
+ test: function testcase() {
+ function callbackfn(prevVal, curVal, idx, obj) {
+ return obj instanceof Error;
+ }
+
+ var obj = new Error();
+ obj.length = 1;
+ obj[0] = 1;
+
+ return Array.prototype.reduce.call(obj, callbackfn, 1);
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-1-15.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-1-15.js
new file mode 100644
index 000000000..5fcaa4d20
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-1-15.js
@@ -0,0 +1,48 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-1-15",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-1-15.js",
+
+ description: "Array.prototype.reduce applied to the Arguments object",
+
+ test: function testcase() {
+
+ function callbackfn(prevVal, curVal, idx, obj) {
+ return ('[object Arguments]' === Object.prototype.toString.call(obj));
+ }
+
+ var obj = (function () {
+ return arguments;
+ }("a", "b"));
+
+ return Array.prototype.reduce.call(obj, callbackfn, 1);
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-1-2.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-1-2.js
new file mode 100644
index 000000000..c5686281b
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-1-2.js
@@ -0,0 +1,44 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-1-2",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-1-2.js",
+
+ description: "Array.prototype.reduce applied to null",
+
+ test: function testcase() {
+ try {
+ Array.prototype.reduce.call(null);
+ return false;
+ } catch (e) {
+ return (e instanceof TypeError);
+ }
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-1-3.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-1-3.js
new file mode 100644
index 000000000..7c6038d54
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-1-3.js
@@ -0,0 +1,53 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-1-3",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-1-3.js",
+
+ description: "Array.prototype.reduce applied to boolean primitive",
+
+ test: function testcase() {
+
+ function callbackfn(prevVal, curVal, idx, obj) {
+ return obj instanceof Boolean;
+ }
+
+ try {
+ Boolean.prototype[0] = true;
+ Boolean.prototype.length = 1;
+
+ return Array.prototype.reduce.call(false, callbackfn, 1);
+
+ } finally {
+ delete Boolean.prototype[0];
+ delete Boolean.prototype.length;
+ }
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-1-4.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-1-4.js
new file mode 100644
index 000000000..02f8819af
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-1-4.js
@@ -0,0 +1,48 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-1-4",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-1-4.js",
+
+ description: "Array.prototype.reduce applied to Boolean object",
+
+ test: function testcase() {
+ function callbackfn(prevVal, curVal, idx, obj) {
+ return obj instanceof Boolean;
+ }
+
+ var obj = new Boolean(true);
+ obj.length = 2;
+ obj[0] = 11;
+ obj[1] = 12;
+
+ return Array.prototype.reduce.call(obj, callbackfn, 1);
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-1-5.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-1-5.js
new file mode 100644
index 000000000..b4a907fc0
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-1-5.js
@@ -0,0 +1,51 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-1-5",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-1-5.js",
+
+ description: "Array.prototype.reduce applied to number primitive",
+
+ test: function testcase() {
+ function callbackfn(prevVal, curVal, idx, obj) {
+ return obj instanceof Number;
+ }
+
+ try {
+ Number.prototype[0] = 1;
+ Number.prototype.length = 1;
+
+ return Array.prototype.reduce.call(2.5, callbackfn, 1);
+ } finally {
+ delete Number.prototype[0];
+ delete Number.prototype.length;
+ }
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-1-6.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-1-6.js
new file mode 100644
index 000000000..aa8c8c2bc
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-1-6.js
@@ -0,0 +1,47 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-1-6",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-1-6.js",
+
+ description: "Array.prototype.reduce applied to Number object",
+
+ test: function testcase() {
+ function callbackfn(prevVal, curVal, idx, obj) {
+ return obj instanceof Number;
+ }
+
+ var obj = new Number(-128);
+ obj.length = 2;
+ obj[0] = 11;
+ obj[1] = 12;
+ return Array.prototype.reduce.call(obj, callbackfn, 1);
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-1-7.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-1-7.js
new file mode 100644
index 000000000..05a9e2284
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-1-7.js
@@ -0,0 +1,44 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-1-7",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-1-7.js",
+
+ description: "Array.prototype.reduce applied to string primitive",
+
+ test: function testcase() {
+
+ function callbackfn(prevVal, curVal, idx, obj) {
+ return obj instanceof String;
+ }
+
+ return Array.prototype.reduce.call("abc", callbackfn, 1);
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-1-8.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-1-8.js
new file mode 100644
index 000000000..c9646a7b2
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-1-8.js
@@ -0,0 +1,46 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-1-8",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-1-8.js",
+
+ description: "Array.prototype.reduce applied to String object",
+
+ test: function testcase() {
+
+ function callbackfn(prevVal, curVal, idx, obj) {
+ return obj instanceof String;
+ }
+
+ var obj = new String("abc");
+
+ return Array.prototype.reduce.call(obj, callbackfn, 1);
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-1-9.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-1-9.js
new file mode 100644
index 000000000..5f3218586
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-1-9.js
@@ -0,0 +1,49 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-1-9",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-1-9.js",
+
+ description: "Array.prototype.reduce applied to Function object",
+
+ test: function testcase() {
+ function callbackfn(prevVal, curVal, idx, obj) {
+ return obj instanceof Function;
+ }
+
+ var obj = function (a, b) {
+ return a + b;
+ };
+ obj[0] = 11;
+ obj[1] = 9;
+
+ return Array.prototype.reduce.call(obj, callbackfn, 1);
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-10-1.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-10-1.js
new file mode 100644
index 000000000..7c3140574
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-10-1.js
@@ -0,0 +1,51 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.4.4.21-10-1",
+
+path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-10-1.js",
+
+description: "Array.prototype.reduce doesn't mutate the Array on which it is called on",
+
+test: function testcase() {
+
+ function callbackfn(prevVal, curVal, idx, obj)
+ {
+ return 1;
+ }
+ var srcArr = [1,2,3,4,5];
+ srcArr.reduce(callbackfn);
+ if(srcArr[0] === 1 &&
+ srcArr[1] === 2 &&
+ srcArr[2] === 3 &&
+ srcArr[3] === 4 &&
+ srcArr[4] === 5)
+ {
+ return true;
+ }
+
+ },
+
+precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-10-2.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-10-2.js
new file mode 100644
index 000000000..5a233c527
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-10-2.js
@@ -0,0 +1,46 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.4.4.21-10-2",
+
+path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-10-2.js",
+
+description: "Array.prototype.reduce reduces the array in ascending order of indices",
+
+test: function testcase() {
+
+ function callbackfn(prevVal, curVal, idx, obj)
+ {
+ return prevVal + curVal;
+ }
+ var srcArr = ['1','2','3','4','5'];
+ if(srcArr.reduce(callbackfn) === '12345')
+ {
+ return true;
+ }
+
+ },
+
+precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-10-3.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-10-3.js
new file mode 100644
index 000000000..77173b896
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-10-3.js
@@ -0,0 +1,42 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.4.4.21-10-3",
+
+path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-10-3.js",
+
+description: "Array.prototype.reduce - subclassed array of length 1",
+
+test: function testcase() {
+ foo.prototype = [1];
+ function foo() {}
+ var f = new foo();
+
+ function cb(){}
+ if(f.reduce(cb) === 1)
+ return true;
+ },
+
+precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-10-4.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-10-4.js
new file mode 100644
index 000000000..18412c57c
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-10-4.js
@@ -0,0 +1,42 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.4.4.21-10-4",
+
+path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-10-4.js",
+
+description: "Array.prototype.reduce - subclassed array with length more than 1",
+
+test: function testcase() {
+ foo.prototype = new Array(1, 2, 3, 4);
+ function foo() {}
+ var f = new foo();
+
+ function cb(prevVal, curVal, idx, obj){return prevVal + curVal;}
+ if(f.reduce(cb) === 10)
+ return true;
+ },
+
+precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-10-5.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-10-5.js
new file mode 100644
index 000000000..c0345f9e2
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-10-5.js
@@ -0,0 +1,46 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.4.4.21-10-5",
+
+path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-10-5.js",
+
+description: "Array.prototype.reduce reduces the array in ascending order of indices(initialvalue present)",
+
+test: function testcase() {
+
+ function callbackfn(prevVal, curVal, idx, obj)
+ {
+ return prevVal + curVal;
+ }
+ var srcArr = ['1','2','3','4','5'];
+ if(srcArr.reduce(callbackfn,'0') === '012345')
+ {
+ return true;
+ }
+
+ },
+
+precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-10-6.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-10-6.js
new file mode 100644
index 000000000..ee1b67ba6
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-10-6.js
@@ -0,0 +1,42 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.4.4.21-10-6",
+
+path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-10-6.js",
+
+description: "Array.prototype.reduce - subclassed array when initialvalue provided",
+
+test: function testcase() {
+ foo.prototype = [1,2,3,4];
+ function foo() {}
+ var f = new foo();
+
+ function cb(prevVal, curVal, idx, obj){return prevVal + curVal;}
+ if(f.reduce(cb,-1) === 9)
+ return true;
+ },
+
+precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-10-7.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-10-7.js
new file mode 100644
index 000000000..b22276e49
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-10-7.js
@@ -0,0 +1,42 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.4.4.21-10-7",
+
+path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-10-7.js",
+
+description: "Array.prototype.reduce - subclassed array with length 1 and initialvalue provided",
+
+test: function testcase() {
+ foo.prototype = [1];
+ function foo() {}
+ var f = new foo();
+
+ function cb(prevVal, curVal, idx, obj){return prevVal + curVal;}
+ if(f.reduce(cb,-1) === 0)
+ return true;
+ },
+
+precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-10-8.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-10-8.js
new file mode 100644
index 000000000..589cb6d02
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-10-8.js
@@ -0,0 +1,52 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.4.4.21-10-8",
+
+path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-10-8.js",
+
+description: "Array.prototype.reduce doesn't visit expandos",
+
+test: function testcase() {
+
+ var callCnt = 0;
+ function callbackfn(prevVal, curVal, idx, obj)
+ {
+ callCnt++;
+ return curVal;
+ }
+ var srcArr = ['1','2','3','4','5'];
+ srcArr["i"] = 10;
+ srcArr[true] = 11;
+ srcArr.reduce(callbackfn);
+
+ if(callCnt == 4)
+ {
+ return true;
+ }
+
+ },
+
+precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-2-1.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-2-1.js
new file mode 100644
index 000000000..2d3c67c62
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-2-1.js
@@ -0,0 +1,51 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-2-1",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-2-1.js",
+
+ description: "Array.prototype.reduce - 'length' is own data property on an Array-like object",
+
+ test: function testcase() {
+
+ function callbackfn(prevVal, curVal, idx, obj) {
+ return (obj.length === 2);
+ }
+
+ var obj = {
+ 0: 12,
+ 1: 11,
+ 2: 9,
+ length: 2
+ };
+
+ return Array.prototype.reduce.call(obj, callbackfn, 1) === true;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-2-10.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-2-10.js
new file mode 100644
index 000000000..bc3a5da4b
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-2-10.js
@@ -0,0 +1,61 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-2-10",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-2-10.js",
+
+ description: "Array.prototype.reduce applied to Array-like object, 'length' is an inherited accessor property",
+
+ test: function testcase() {
+
+ function callbackfn(prevVal, curVal, idx, obj) {
+ return (obj.length === 2);
+ }
+
+ var proto = {};
+
+ Object.defineProperty(proto, "length", {
+ get: function () {
+ return 2;
+ },
+ configurable: true
+ });
+
+ var Con = function () { };
+ Con.prototype = proto;
+
+ var child = new Con();
+ child[0] = 12;
+ child[1] = 11;
+ child[2] = 9;
+
+ return Array.prototype.reduce.call(child, callbackfn, 1) === true;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce) && fnExists(Object.defineProperty);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-2-11.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-2-11.js
new file mode 100644
index 000000000..12ccda2f6
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-2-11.js
@@ -0,0 +1,54 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-2-11",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-2-11.js",
+
+ description: "Array.prototype.reduce applied to Array-like object, 'length' is an own accessor property without a get function",
+
+ test: function testcase() {
+
+ var accessed = false;
+ function callbackfn(prevVal, curVal, idx, obj) {
+ accessed = true;
+ }
+
+ var obj = {
+ 0: 11,
+ 1: 12
+ };
+ Object.defineProperty(obj, "length", {
+ set: function () { },
+ configurable: true
+ });
+
+ return Array.prototype.reduce.call(obj, callbackfn, 1) === 1 && !accessed;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce) && fnExists(Object.defineProperty);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-2-12.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-2-12.js
new file mode 100644
index 000000000..6aa7553bf
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-2-12.js
@@ -0,0 +1,63 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-2-12",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-2-12.js",
+
+ description: "Array.prototype.reduce - 'length' is own accessor property without a get function that overrides an inherited accessor property on an Array",
+
+ test: function testcase() {
+
+ var accessed = false;
+ function callbackfn(prevVal, curVal, idx, obj) {
+ accessed = true;
+ }
+
+ try {
+ Object.defineProperty(Object.prototype, "length", {
+ get: function () {
+ return 2;
+ },
+ configurable: true
+ });
+
+ var obj = { 0: 12, 1: 11 };
+ Object.defineProperty(obj, "length", {
+ set: function () { },
+ configurable: true
+ });
+
+ return Array.prototype.reduce.call(obj, callbackfn, 1) === 1 && !accessed;
+ } finally {
+ delete Object.prototype.length;
+ }
+
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce) && fnExists(Object.defineProperty);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-2-13.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-2-13.js
new file mode 100644
index 000000000..f8e850312
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-2-13.js
@@ -0,0 +1,59 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-2-13",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-2-13.js",
+
+ description: "Array.prototype.reduce applied to Array-like object that 'length' is inherited accessor property without a get function",
+
+ test: function testcase() {
+
+ var accessed = false;
+
+ function callbackfn(prevVal, curVal, idx, obj) {
+ accessed = true;
+ }
+
+ var proto = {};
+ Object.defineProperty(proto, "length", {
+ set: function () { },
+ configurable: true
+ });
+
+ var Con = function () { };
+ Con.prototype = proto;
+
+ var child = new Con();
+ child[0] = 11;
+ child[1] = 12;
+
+ return Array.prototype.reduce.call(child, callbackfn, 1) === 1 && !accessed;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce) && fnExists(Object.defineProperty);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-2-14.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-2-14.js
new file mode 100644
index 000000000..e857eb6a2
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-2-14.js
@@ -0,0 +1,49 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-2-14",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-2-14.js",
+
+ description: "Array.prototype.reduce applied to the Array-like object that 'length' property doesn't exist",
+
+ test: function testcase() {
+
+ var accessed = false;
+
+ function callbackfn(prevVal, curVal, idx, obj) {
+ accessed = true;
+ }
+
+ var obj = { 0: 11, 1: 12 };
+
+ return Array.prototype.reduce.call(obj, callbackfn, 1) === 1 && !accessed;
+
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-2-15.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-2-15.js
new file mode 100644
index 000000000..781096e86
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-2-15.js
@@ -0,0 +1,56 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-2-15",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-2-15.js",
+
+ description: "Array.prototype.reduce - 'length' is property of the global object",
+
+ test: function testcase() {
+
+ function callbackfn(prevVal, curVal, idx, obj) {
+ return (obj.length === 2);
+ }
+
+ try {
+ var oldLen = fnGlobalObject().length;
+ fnGlobalObject()[0] = 12;
+ fnGlobalObject()[1] = 11;
+ fnGlobalObject()[2] = 9;
+ fnGlobalObject().length = 2;
+ return Array.prototype.reduce.call(fnGlobalObject(), callbackfn, 1) === true;
+ } finally {
+ delete fnGlobalObject()[0];
+ delete fnGlobalObject()[1];
+ delete fnGlobalObject()[2];
+ fnGlobalObject().length = oldLen;
+ }
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-2-17.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-2-17.js
new file mode 100644
index 000000000..1f9cc0199
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-2-17.js
@@ -0,0 +1,49 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-2-17",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-2-17.js",
+
+ description: "Array.prototype.reduce applied to the Arguments object, which implements its own property get method",
+
+ test: function testcase() {
+
+ function callbackfn(prevVal, curVal, idx, obj) {
+ return (obj.length === 2);
+ }
+
+ var func = function (a, b) {
+ arguments[2] = 9;
+ return Array.prototype.reduce.call(arguments, callbackfn, 1);
+ };
+
+ return func(12, 11) === true;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-2-18.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-2-18.js
new file mode 100644
index 000000000..8d740f90d
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-2-18.js
@@ -0,0 +1,46 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-2-18",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-2-18.js",
+
+ description: "Array.prototype.reduce applied to String object, which implements its own property get method",
+
+ test: function testcase() {
+
+ function callbackfn(prevVal, curVal, idx, obj) {
+ return (obj.length === 3);
+ }
+
+ var str = new String("012");
+
+ return Array.prototype.reduce.call(str, callbackfn, 1) === true;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-2-19.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-2-19.js
new file mode 100644
index 000000000..83c4549b0
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-2-19.js
@@ -0,0 +1,51 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-2-19",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-2-19.js",
+
+ description: "Array.prototype.reduce applied to Function object, which implements its own property get method",
+
+ test: function testcase() {
+
+ function callbackfn(prevVal, curVal, idx, obj) {
+ return (obj.length === 2);
+ }
+
+ var fun = function (a, b) {
+ return a + b;
+ };
+ fun[0] = 12;
+ fun[1] = 11;
+ fun[2] = 9;
+
+ return Array.prototype.reduce.call(fun, callbackfn, 1) === true;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-2-2.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-2-2.js
new file mode 100644
index 000000000..10ffb32f8
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-2-2.js
@@ -0,0 +1,44 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-2-2",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-2-2.js",
+
+ description: "Array.prototype.reduce - 'length' is own data property on an Array",
+
+ test: function testcase() {
+
+ function callbackfn(prevVal, curVal, idx, obj) {
+ return (obj.length === 2);
+ }
+
+ return [12, 11].reduce(callbackfn, 1) === true;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-2-3.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-2-3.js
new file mode 100644
index 000000000..7db7e92a2
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-2-3.js
@@ -0,0 +1,55 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-2-3",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-2-3.js",
+
+ description: "Array.prototype.reduce - 'length' is an own data property that overrides an inherited data property on an Array-like object",
+
+ test: function testcase() {
+
+ function callbackfn(prevVal, curVal, idx, obj) {
+ return (obj.length === 2);
+ }
+
+ var proto = { length: 3 };
+
+ var Con = function () { };
+ Con.prototype = proto;
+
+ var child = new Con();
+ child.length = 2;
+ child[0] = 12;
+ child[1] = 11;
+ child[2] = 9;
+
+ return Array.prototype.reduce.call(child, callbackfn, 1) === true;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-2-4.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-2-4.js
new file mode 100644
index 000000000..4fc4386f4
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-2-4.js
@@ -0,0 +1,52 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-2-4",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-2-4.js",
+
+ description: "Array.prototype.reduce - 'length' is own data property that overrides an inherited data property on an Array",
+
+ test: function testcase() {
+ var storeProtoLength;
+
+ function callbackfn(prevVal, curVal, idx, obj) {
+ return (obj.length === 2);
+ }
+
+ try {
+ storeProtoLength = Array.prototype.length;
+ Array.prototype.length = 0;
+
+ return [12, 11].reduce(callbackfn, 1) === true;
+ } finally {
+ Array.prototype.length = storeProtoLength;
+ }
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-2-5.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-2-5.js
new file mode 100644
index 000000000..ab9fa80bc
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-2-5.js
@@ -0,0 +1,65 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-2-5",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-2-5.js",
+
+ description: "Array.prototype.reduce applied to Array-like object, 'length' is an own data property that overrides an inherited accessor property",
+
+ test: function testcase() {
+
+ function callbackfn(prevVal, curVal, idx, obj) {
+ return (obj.length === 2);
+ }
+
+ var proto = {};
+
+ Object.defineProperty(proto, "length", {
+ get: function () {
+ return 3;
+ },
+ configurable: true
+ });
+
+ var Con = function () { };
+ Con.prototype = proto;
+
+ var child = new Con();
+ Object.defineProperty(child, "length", {
+ value: 2,
+ configurable: true
+ });
+ child[0] = 12;
+ child[1] = 11;
+ child[2] = 9;
+
+ return Array.prototype.reduce.call(child, callbackfn, 1) === true;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce) && fnExists(Object.defineProperty);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-2-6.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-2-6.js
new file mode 100644
index 000000000..ed15ee56d
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-2-6.js
@@ -0,0 +1,54 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-2-6",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-2-6.js",
+
+ description: "Array.prototype.reduce applied to Array-like object, 'length' is an inherited data property",
+
+ test: function testcase() {
+
+ function callbackfn(prevVal, curVal, idx, obj) {
+ return (obj.length === 2);
+ }
+
+ var proto = { length: 2 };
+
+ var Con = function () { };
+ Con.prototype = proto;
+
+ var child = new Con();
+ child[0] = 12;
+ child[1] = 11;
+ child[2] = 9;
+
+ return Array.prototype.reduce.call(child, callbackfn, 1) === true;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-2-7.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-2-7.js
new file mode 100644
index 000000000..2a2a0fc72
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-2-7.js
@@ -0,0 +1,57 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-2-7",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-2-7.js",
+
+ description: "Array.prototype.reduce applied to Array-like object, 'length' is an own accessor property",
+
+ test: function testcase() {
+
+ function callbackfn(prevVal, curVal, idx, obj) {
+ return (obj.length === 2);
+ }
+
+ var obj = {};
+
+ Object.defineProperty(obj, "length", {
+ get: function () {
+ return 2;
+ },
+ configurable: true
+ });
+
+ obj[0] = 12;
+ obj[1] = 11;
+ obj[2] = 9;
+
+ return Array.prototype.reduce.call(obj, callbackfn, 1) === true;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce) && fnExists(Object.defineProperty);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-2-8.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-2-8.js
new file mode 100644
index 000000000..56c0ee727
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-2-8.js
@@ -0,0 +1,62 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-2-8",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-2-8.js",
+
+ description: "Array.prototype.reduce applied to Array-like object, 'length' is an own accessor property that overrides an inherited data property",
+
+ test: function testcase() {
+
+ function callbackfn(prevVal, curVal, idx, obj) {
+ return (obj.length === 2);
+ }
+
+ var proto = { length: 3 };
+
+ var Con = function () { };
+ Con.prototype = proto;
+
+ var child = new Con();
+
+ Object.defineProperty(child, "length", {
+ get: function () {
+ return 2;
+ },
+ configurable: true
+ });
+
+ child[0] = 12;
+ child[1] = 11;
+ child[2] = 9;
+
+ return Array.prototype.reduce.call(child, callbackfn, 1) === true;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce) && fnExists(Object.defineProperty);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-2-9.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-2-9.js
new file mode 100644
index 000000000..9fac26fb5
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-2-9.js
@@ -0,0 +1,69 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-2-9",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-2-9.js",
+
+ description: "Array.prototype.reduce applied to Array-like object, 'length' is an own accessor property that overrides an inherited accessor property",
+
+ test: function testcase() {
+
+ function callbackfn(prevVal, curVal, idx, obj) {
+ return (obj.length === 2);
+ }
+
+ var proto = {};
+
+ Object.defineProperty(proto, "length", {
+ get: function () {
+ return 3;
+ },
+ configurable: true
+ });
+
+ var Con = function () { };
+ Con.prototype = proto;
+
+ var child = new Con();
+
+ Object.defineProperty(child, "length", {
+ get: function () {
+ return 2;
+ },
+ configurable: true
+ });
+
+ child[0] = 12;
+ child[1] = 11;
+ child[2] = 9;
+
+ return Array.prototype.reduce.call(child, callbackfn, 1) === true;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce) && fnExists(Object.defineProperty);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-1.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-1.js
new file mode 100644
index 000000000..674e94b8b
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-1.js
@@ -0,0 +1,49 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-3-1",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-1.js",
+
+ description: "Array.prototype.reduce - value of 'length' is undefined",
+
+ test: function testcase() {
+
+ var accessed = false;
+
+ function callbackfn(prevVal, curVal, idx, obj) {
+ accessed = true;
+ return 2;
+ }
+
+ var obj = { 0: 0, 1: 1, length: undefined };
+
+ return Array.prototype.reduce.call(obj, callbackfn, 1) === 1 && !accessed;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-10.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-10.js
new file mode 100644
index 000000000..a878d5479
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-10.js
@@ -0,0 +1,49 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-3-10",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-10.js",
+
+ description: "Array.prototype.reduce - value of 'length' is number primitive (value is NaN)",
+
+ test: function testcase() {
+
+ var accessed = false;
+
+ function callbackfn(prevVal, curVal, idx, obj) {
+ accessed = true;
+ return 2;
+ }
+
+ var obj = { 0: 9, length: NaN };
+
+ return Array.prototype.reduce.call(obj, callbackfn, 1) === 1 && !accessed;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-11.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-11.js
new file mode 100644
index 000000000..ec4dac4bb
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-11.js
@@ -0,0 +1,46 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-3-11",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-11.js",
+
+ description: "Array.prototype.reduce - 'length' is a string containing a positive number",
+
+ test: function testcase() {
+
+ function callbackfn(prevVal, curVal, idx, obj) {
+ return (curVal === 11 && idx === 1);
+ }
+
+ var obj = { 1: 11, 2: 9, length: "2" };
+
+ return Array.prototype.reduce.call(obj, callbackfn, 1) === true;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-12.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-12.js
new file mode 100644
index 000000000..f576a3981
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-12.js
@@ -0,0 +1,46 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-3-12",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-12.js",
+
+ description: "Array.prototype.reduce - 'length' is a string containing a negative number",
+
+ test: function testcase() {
+
+ function callbackfn(prevVal, curVal, idx, obj) {
+ return (curVal === 11 && idx === 1);
+ }
+
+ var obj = { 1: 11, 2: 9, length: "-4294967294" };
+
+ return Array.prototype.reduce.call(obj, callbackfn, 1) === true;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-13.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-13.js
new file mode 100644
index 000000000..85303d077
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-13.js
@@ -0,0 +1,46 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-3-13",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-13.js",
+
+ description: "Array.prototype.reduce - 'length' is a string containing a decimal number",
+
+ test: function testcase() {
+
+ function callbackfn(prevVal, curVal, idx, obj) {
+ return (curVal === 11 && idx === 1);
+ }
+
+ var obj = { 1: 11, 2: 9, length: "2.5" };
+
+ return Array.prototype.reduce.call(obj, callbackfn, 1) === true;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-14.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-14.js
new file mode 100644
index 000000000..c18ab3f94
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-14.js
@@ -0,0 +1,66 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-3-14",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-14.js",
+
+ description: "Array.prototype.reduce - 'length' is a string containing +/-Infinity",
+
+ test: function testcase() {
+
+ var accessed1 = false;
+ var accessed2 = false;
+ var accessed3 = false;
+
+ function callbackfn1(prevVal, curVal, idx, obj) {
+ accessed1 = true;
+ return 2;
+ }
+
+ function callbackfn2(prevVal, curVal, idx, obj) {
+ accessed2 = true;
+ return 2;
+ }
+
+ function callbackfn3(prevVal, curVal, idx, obj) {
+ accessed3 = true;
+ return 2;
+ }
+
+ var obj1 = { 0: 9, length: "Infinity" };
+ var obj2 = { 0: 9, length: "-Infinity" };
+ var obj3 = { 0: 9, length: "+Infinity" };
+
+ return Array.prototype.reduce.call(obj1, callbackfn1, 1) === 1 &&
+ Array.prototype.reduce.call(obj2, callbackfn2, 1) === 1 &&
+ Array.prototype.reduce.call(obj3, callbackfn3, 1) === 1 &&
+ !accessed1 && !accessed2 && !accessed3;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-15.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-15.js
new file mode 100644
index 000000000..ad30b2604
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-15.js
@@ -0,0 +1,46 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-3-15",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-15.js",
+
+ description: "Array.prototype.reduce - 'length' is a string containing an exponential number",
+
+ test: function testcase() {
+
+ function callbackfn(prevVal, curVal, idx, obj) {
+ return (curVal === 11 && idx === 1);
+ }
+
+ var obj = { 1: 11, 2: 9, length: "2E0" };
+
+ return Array.prototype.reduce.call(obj, callbackfn, 1) === true;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-16.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-16.js
new file mode 100644
index 000000000..dfe49a7cd
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-16.js
@@ -0,0 +1,46 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-3-16",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-16.js",
+
+ description: "Array.prototype.reduce - 'length' is a string containing a hex number",
+
+ test: function testcase() {
+
+ function callbackfn(prevVal, curVal, idx, obj) {
+ return (curVal === 11 && idx === 1);
+ }
+
+ var obj = { 1: 11, 2: 9, length: "0x0002" };
+
+ return Array.prototype.reduce.call(obj, callbackfn, 1) === true;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-17.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-17.js
new file mode 100644
index 000000000..104b3265f
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-17.js
@@ -0,0 +1,46 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-3-17",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-17.js",
+
+ description: "Array.prototype.reduce - 'length' is a string containing a number with leading zeros",
+
+ test: function testcase() {
+
+ function callbackfn(prevVal, curVal, idx, obj) {
+ return (curVal === 11 && idx === 1);
+ }
+
+ var obj = { 1: 11, 2: 9, length: "0002.00" };
+
+ return Array.prototype.reduce.call(obj, callbackfn, 1) === true;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-18.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-18.js
new file mode 100644
index 000000000..1fc0fed40
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-18.js
@@ -0,0 +1,48 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-3-18",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-18.js",
+
+ description: "Array.prototype.reduce - value of 'length' is a string that can't convert to a number",
+
+ test: function testcase() {
+
+ var accessed = false;
+ function callbackfn(prevVal, curVal, idx, obj) {
+ accessed = true;
+ return 2;
+ }
+
+ var obj = { 0: 9, length: "asdf!_" };
+
+ return Array.prototype.reduce.call(obj, callbackfn, 1) === 1 && !accessed;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-19.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-19.js
new file mode 100644
index 000000000..170e81c6e
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-19.js
@@ -0,0 +1,54 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-3-19",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-19.js",
+
+ description: "Array.prototype.reduce - value of 'length' is an Object which has an own toString method",
+
+ test: function testcase() {
+
+ function callbackfn(prevVal, curVal, idx, obj) {
+ return (curVal === 11 && idx === 1);
+ }
+
+ var obj = {
+ 1: 11,
+ 2: 9,
+ length: {
+ toString: function () {
+ return '2';
+ }
+ }
+ };
+
+ return Array.prototype.reduce.call(obj, callbackfn, 1) === true;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-2.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-2.js
new file mode 100644
index 000000000..b65057233
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-2.js
@@ -0,0 +1,47 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-3-2",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-2.js",
+
+ description: "Array.prototype.reduce - value of 'length' is a boolean (value is true)",
+
+ test: function testcase() {
+
+ function callbackfn(prevVal, curVal, idx, obj) {
+ return (curVal === 11 && idx === 0);
+ }
+
+ var obj = { 0: 11, 1: 9, length: true };
+
+ return Array.prototype.reduce.call(obj, callbackfn, 1) === true;
+
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-20.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-20.js
new file mode 100644
index 000000000..afaec33d6
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-20.js
@@ -0,0 +1,54 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-3-20",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-20.js",
+
+ description: "Array.prototype.reduce - value of 'length' is an object which has an own valueOf method",
+
+ test: function testcase() {
+
+ function callbackfn(prevVal, curVal, idx, obj) {
+ return (curVal === 11 && idx === 1);
+ }
+
+ var obj = {
+ 1: 11,
+ 2: 9,
+ length: {
+ valueOf: function () {
+ return 2;
+ }
+ }
+ };
+
+ return Array.prototype.reduce.call(obj, callbackfn, 1) === true;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-21.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-21.js
new file mode 100644
index 000000000..2f307e3a2
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-21.js
@@ -0,0 +1,62 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-3-21",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-21.js",
+
+ description: "Array.prototype.reduce - 'length' is an object that has an own valueOf method that returns an object and toString method that returns a string",
+
+ test: function testcase() {
+
+ var valueOfOccured = false;
+ var toStringOccured = false;
+
+ function callbackfn(prevVal, curVal, idx, obj) {
+ return (curVal === 11 && idx === 1);
+ }
+
+ var obj = {
+ 1: 11,
+ 2: 9,
+ length: {
+ valueOf: function () {
+ valueOfOccured = true;
+ return {};
+ },
+ toString: function () {
+ toStringOccured = true;
+ return '2';
+ }
+ }
+ };
+
+ return Array.prototype.reduce.call(obj, callbackfn, 1) === true && valueOfOccured && toStringOccured;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-22.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-22.js
new file mode 100644
index 000000000..0981455f6
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-22.js
@@ -0,0 +1,70 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-3-22",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-22.js",
+
+ description: "Array.prototype.reduce throws TypeError exception - 'length' is an object with toString and valueOf methods that don’t return primitive values",
+
+ test: function testcase() {
+
+ var accessed = false;
+ var valueOfAccessed = false;
+ var toStringAccessed = false;
+
+ function callbackfn(prevVal, curVal, idx, obj) {
+ accessed = true;
+ return true;
+ }
+
+ var obj = {
+ 1: 11,
+ 2: 12,
+
+ length: {
+ valueOf: function () {
+ valueOfAccessed = true;
+ return {};
+ },
+ toString: function () {
+ toStringAccessed = true;
+ return {};
+ }
+ }
+ };
+
+ try {
+ Array.prototype.reduce.call(obj, callbackfn, 1);
+ return false;
+ } catch (ex) {
+ return (ex instanceof TypeError) && !accessed && toStringAccessed && valueOfAccessed;
+ }
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-23.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-23.js
new file mode 100644
index 000000000..697ccb05b
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-23.js
@@ -0,0 +1,70 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-3-23",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-23.js",
+
+ description: "Array.prototype.reduce uses inherited valueOf method - 'length' is an object with an own toString and inherited valueOf methods",
+
+ test: function testcase() {
+
+ var valueOfAccessed = false;
+ var toStringAccessed = false;
+
+ function callbackfn(prevVal, curVal, idx, obj) {
+ return (curVal === 11 && idx === 1);
+ }
+
+ var proto = {
+ valueOf: function () {
+ valueOfAccessed = true;
+ return 2;
+ }
+ };
+
+ var Con = function () { };
+ Con.prototype = proto;
+
+ var child = new Con();
+
+ child.toString = function () {
+ toStringAccessed = true;
+ return '1';
+ };
+
+ var obj = {
+ 1: 11,
+ 2: 9,
+ length: child
+ };
+
+ return Array.prototype.reduce.call(obj, callbackfn, 1) === true && valueOfAccessed && !toStringAccessed;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-24.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-24.js
new file mode 100644
index 000000000..eedca6bdb
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-24.js
@@ -0,0 +1,49 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-3-24",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-24.js",
+
+ description: "Array.prototype.reduce - value of 'length' is a positive non-integer, ensure truncation occurs in the proper direction",
+
+ test: function testcase() {
+ function callbackfn(prevVal, curVal, idx, obj) {
+ return (curVal === 11 && idx === 1);
+ }
+
+ var obj = {
+ 1: 11,
+ 2: 9,
+ length: 2.685
+ };
+
+ return Array.prototype.reduce.call(obj, callbackfn, 1) === true;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-25.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-25.js
new file mode 100644
index 000000000..26ef9c1b6
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-25.js
@@ -0,0 +1,50 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-3-25",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-25.js",
+
+ description: "Array.prototype.reduce - value of 'length' is a negative non-integer, ensure truncation occurs in the proper direction",
+
+ test: function testcase() {
+
+ function callbackfn(prevVal, curVal, idx, obj) {
+ return (curVal === 11 && idx === 1);
+ }
+
+ var obj = {
+ 1: 11,
+ 2: 9,
+ length: -4294967294.5
+ };
+
+ return Array.prototype.reduce.call(obj, callbackfn, 1) === true;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-28.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-28.js
new file mode 100644
index 000000000..87948f3d5
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-28.js
@@ -0,0 +1,52 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-3-28",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-28.js",
+
+ description: "Array.prototype.reduce - value of 'length' is boundary value (2^32)",
+
+ test: function testcase() {
+
+ var accessed = false;
+
+ function callbackfn(prevVal, curVal, idx, obj) {
+ accessed = true;
+ return 2;
+ }
+
+ var obj = {
+ 0: 12,
+ length: 4294967296
+ };
+
+ return Array.prototype.reduce.call(obj, callbackfn, 1) === 1 && !accessed;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-29.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-29.js
new file mode 100644
index 000000000..41c4b867e
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-29.js
@@ -0,0 +1,50 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-3-29",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-29.js",
+
+ description: "Array.prototype.reduce - value of 'length' is boundary value (2^32 + 1)",
+
+ test: function testcase() {
+
+ function callbackfn(prevVal, curVal, idx, obj) {
+ return (curVal === 11 && idx === 0);
+ }
+
+ var obj = {
+ 0: 11,
+ 1: 9,
+ length: 4294967297
+ };
+
+ return Array.prototype.reduce.call(obj, callbackfn, 1);
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-3.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-3.js
new file mode 100644
index 000000000..c37887ac0
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-3.js
@@ -0,0 +1,49 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-3-3",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-3.js",
+
+ description: "Array.prototype.reduce - value of 'length' is a number (value is 0)",
+
+ test: function testcase() {
+
+ var accessed = false;
+
+ function callbackfn(prevVal, curVal, idx, obj) {
+ accessed = true;
+ return 2;
+ }
+
+ var obj = { 0: 1, 1: 1, length: 0 };
+
+ return Array.prototype.reduce.call(obj, callbackfn, 1) === 1 && !accessed;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-4.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-4.js
new file mode 100644
index 000000000..d28d6ddd2
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-4.js
@@ -0,0 +1,49 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-3-4",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-4.js",
+
+ description: "Array.prototype.reduce - value of 'length' is a number (value is +0)",
+
+ test: function testcase() {
+
+ var accessed = false;
+
+ function callbackfn(prevVal, curVal, idx, obj) {
+ accessed = true;
+ return 2;
+ }
+
+ var obj = { 0: 11, length: +0 };
+
+ return Array.prototype.reduce.call(obj, callbackfn, 1) === 1 && !accessed;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-5.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-5.js
new file mode 100644
index 000000000..53f88e671
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-5.js
@@ -0,0 +1,49 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-3-5",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-5.js",
+
+ description: "Array.prototype.reduce - value of 'length' is a number (value is -0)",
+
+ test: function testcase() {
+
+ var accessed = false;
+
+ function callbackfn(prevVal, curVal, idx, obj) {
+ accessed = true;
+ return 2;
+ }
+
+ var obj = { 0: 11, length: -0 };
+
+ return Array.prototype.reduce.call(obj, callbackfn, 1) === 1 && !accessed;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-6.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-6.js
new file mode 100644
index 000000000..4e40e72e4
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-6.js
@@ -0,0 +1,46 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-3-6",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-6.js",
+
+ description: "Array.prototype.reduce - value of 'length' is a number (value is positive)",
+
+ test: function testcase() {
+
+ function callbackfn(prevVal, curVal, idx, obj) {
+ return (curVal === 11 && idx === 1);
+ }
+
+ var obj = { 1: 11, 2: 9, length: 2 };
+
+ return Array.prototype.reduce.call(obj, callbackfn, 1) === true;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-7.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-7.js
new file mode 100644
index 000000000..7f3b28947
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-7.js
@@ -0,0 +1,46 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-3-7",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-7.js",
+
+ description: "Array.prototype.reduce - value of 'length' is a number (value is negative)",
+
+ test: function testcase() {
+
+ function callbackfn(prevVal, curVal, idx, obj) {
+ return (curVal === 11 && idx === 1);
+ }
+
+ var obj = { 1: 11, 2: 9, length: -4294967294 };
+
+ return Array.prototype.reduce.call(obj, callbackfn, 1) === true;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-8.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-8.js
new file mode 100644
index 000000000..63e3d8fa5
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-8.js
@@ -0,0 +1,49 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-3-8",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-8.js",
+
+ description: "Array.prototype.reduce - value of 'length' is a number (value is Infinity)",
+
+ test: function testcase() {
+
+ var accessed = false;
+
+ function callbackfn(prevVal, curVal, idx, obj) {
+ accessed = true;
+ return 2;
+ }
+
+ var obj = { 0: 9, length: Infinity };
+
+ return Array.prototype.reduce.call(obj, callbackfn, 1) === 1 && !accessed;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-9.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-9.js
new file mode 100644
index 000000000..9cbd79ec8
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-9.js
@@ -0,0 +1,48 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-3-9",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-9.js",
+
+ description: "Array.prototype.reduce - value of 'length' is a number (value is -Infinity)",
+
+ test: function testcase() {
+
+ var accessed = false;
+
+ function callbackfn(prevVal, curVal, idx, obj) {
+ accessed = true;
+ }
+
+ var obj = { 0: 9, length: -Infinity };
+
+ return Array.prototype.reduce.call(obj, callbackfn, 1) === 1 && !accessed;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-4-1.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-4-1.js
new file mode 100644
index 000000000..de2bab9e0
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-4-1.js
@@ -0,0 +1,45 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.4.4.21-4-1",
+
+path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-4-1.js",
+
+description: "Array.prototype.reduce throws TypeError if callbackfn is undefined",
+
+test: function testcase() {
+
+ var arr = new Array(10);
+ try {
+ arr.reduce();
+ }
+ catch(e) {
+ if(e instanceof TypeError)
+ return true;
+ }
+
+ },
+
+precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-4-10.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-4-10.js
new file mode 100644
index 000000000..7486e4e27
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-4-10.js
@@ -0,0 +1,54 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-4-10",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-4-10.js",
+
+ description: "Array.prototype.reduce - the exception is not thrown if exception was thrown by step 2",
+
+ test: function testcase() {
+
+ var obj = { 0: 11, 1: 12 };
+
+ Object.defineProperty(obj, "length", {
+ get: function () {
+ throw new SyntaxError();
+ },
+ configurable: true
+ });
+
+ try {
+ Array.prototype.reduce.call(obj, undefined);
+ return false;
+ } catch (ex) {
+ return !(ex instanceof TypeError);
+ }
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce) && fnExists(Object.defineProperty);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-4-11.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-4-11.js
new file mode 100644
index 000000000..66fd936a2
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-4-11.js
@@ -0,0 +1,58 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-4-11",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-4-11.js",
+
+ description: "Array.prototype.reduce - the exception is not thrown if exception was thrown by step 3",
+
+ test: function testcase() {
+
+ var obj = { 0: 11, 1: 12 };
+
+ Object.defineProperty(obj, "length", {
+ get: function () {
+ return {
+ toString: function () {
+ throw new SyntaxError();
+ }
+ };
+ },
+ configurable: true
+ });
+
+ try {
+ Array.prototype.reduce.call(obj, undefined);
+ return false;
+ } catch (ex) {
+ return !(ex instanceof TypeError);
+ }
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce) && fnExists(Object.defineProperty);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-4-12.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-4-12.js
new file mode 100644
index 000000000..31b3e606e
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-4-12.js
@@ -0,0 +1,46 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-4-12",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-4-12.js",
+
+ description: "Array.prototype.reduce - 'callbackfn' is a function",
+
+ test: function testcase() {
+
+ var accessed = false;
+ function callbackfn(prevVal, curVal, idx, obj) {
+ accessed = true;
+ return curVal > 10;
+ }
+
+ return [11, 9].reduce(callbackfn, 1) === false && accessed;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-4-15.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-4-15.js
new file mode 100644
index 000000000..038813387
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-4-15.js
@@ -0,0 +1,64 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-4-15",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-4-15.js",
+
+ description: "Array.prototype.reduce - calling with no callbackfn is the same as passing undefined for callbackfn",
+
+ test: function testcase() {
+ var obj = { 10: 10 };
+ var lengthAccessed = false;
+ var loopAccessed = false;
+
+ Object.defineProperty(obj, "length", {
+ get: function () {
+ lengthAccessed = true;
+ return 20;
+ },
+ configurable: true
+ });
+
+ Object.defineProperty(obj, "0", {
+ get: function () {
+ loopAccessed = true;
+ return 10;
+ },
+ configurable: true
+ });
+
+ try {
+ Array.prototype.reduce.call(obj);
+ return false;
+ } catch (ex) {
+ return (ex instanceof TypeError) && lengthAccessed && !loopAccessed;
+ }
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce) && fnExists(Object.defineProperty) && fnSupportsArrayIndexGettersOnObjects();
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-4-2.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-4-2.js
new file mode 100644
index 000000000..20ba2697a
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-4-2.js
@@ -0,0 +1,45 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.4.4.21-4-2",
+
+path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-4-2.js",
+
+description: "Array.prototype.reduce throws ReferenceError if callbackfn is unreferenced",
+
+test: function testcase() {
+
+ var arr = new Array(10);
+ try {
+ arr.reduce(foo);
+ }
+ catch(e) {
+ if(e instanceof ReferenceError)
+ return true;
+ }
+
+ },
+
+precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-4-3.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-4-3.js
new file mode 100644
index 000000000..de0a6669d
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-4-3.js
@@ -0,0 +1,45 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.4.4.21-4-3",
+
+path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-4-3.js",
+
+description: "Array.prototype.reduce throws TypeError if callbackfn is null",
+
+test: function testcase() {
+
+ var arr = new Array(10);
+ try {
+ arr.reduce(null);
+ }
+ catch(e) {
+ if(e instanceof TypeError)
+ return true;
+ }
+
+ },
+
+precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-4-4.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-4-4.js
new file mode 100644
index 000000000..3b14e4b9a
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-4-4.js
@@ -0,0 +1,45 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.4.4.21-4-4",
+
+path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-4-4.js",
+
+description: "Array.prototype.reduce throws TypeError if callbackfn is boolean",
+
+test: function testcase() {
+
+ var arr = new Array(10);
+ try {
+ arr.reduce(true);
+ }
+ catch(e) {
+ if(e instanceof TypeError)
+ return true;
+ }
+
+ },
+
+precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-4-5.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-4-5.js
new file mode 100644
index 000000000..1639215b2
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-4-5.js
@@ -0,0 +1,45 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.4.4.21-4-5",
+
+path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-4-5.js",
+
+description: "Array.prototype.reduce throws TypeError if callbackfn is number",
+
+test: function testcase() {
+
+ var arr = new Array(10);
+ try {
+ arr.reduce(5);
+ }
+ catch(e) {
+ if(e instanceof TypeError)
+ return true;
+ }
+
+ },
+
+precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-4-6.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-4-6.js
new file mode 100644
index 000000000..a145ee955
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-4-6.js
@@ -0,0 +1,45 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.4.4.21-4-6",
+
+path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-4-6.js",
+
+description: "Array.prototype.reduce throws TypeError if callbackfn is string",
+
+test: function testcase() {
+
+ var arr = new Array(10);
+ try {
+ arr.reduce("abc");
+ }
+ catch(e) {
+ if(e instanceof TypeError)
+ return true;
+ }
+
+ },
+
+precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-4-7.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-4-7.js
new file mode 100644
index 000000000..9373ba433
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-4-7.js
@@ -0,0 +1,45 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.4.4.21-4-7",
+
+path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-4-7.js",
+
+description: "Array.prototype.reduce throws TypeError if callbackfn is Object without [[Call]] internal method",
+
+test: function testcase() {
+
+ var arr = new Array(10);
+ try {
+ arr.reduce(new Object());
+ }
+ catch(e) {
+ if(e instanceof TypeError)
+ return true;
+ }
+
+ },
+
+precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-4-8.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-4-8.js
new file mode 100644
index 000000000..e8fd8885a
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-4-8.js
@@ -0,0 +1,57 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-4-8",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-4-8.js",
+
+ description: "Array.prototype.reduce - side effects produced by step 2 are visible when an exception occurs",
+
+ test: function testcase() {
+
+ var obj = { 0: 11, 1: 12 };
+
+ var accessed = false;
+
+ Object.defineProperty(obj, "length", {
+ get: function () {
+ accessed = true;
+ return 2;
+ },
+ configurable: true
+ });
+
+ try {
+ Array.prototype.reduce.call(obj, null);
+ return false;
+ } catch (ex) {
+ return ex instanceof TypeError && accessed;
+ }
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce) && fnExists(Object.defineProperty);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-4-9.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-4-9.js
new file mode 100644
index 000000000..489fd066e
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-4-9.js
@@ -0,0 +1,61 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-4-9",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-4-9.js",
+
+ description: "Array.prototype.reduce - side effects produced by step 3 are visible when an exception occurs",
+
+ test: function testcase() {
+
+ var obj = { 0: 11, 1: 12 };
+
+ var accessed = false;
+
+ Object.defineProperty(obj, "length", {
+ get: function () {
+ return {
+ toString: function () {
+ accessed = true;
+ return "2";
+ }
+ };
+ },
+ configurable: true
+ });
+
+ try {
+ Array.prototype.reduce.call(obj, null);
+ return false;
+ } catch (ex) {
+ return ex instanceof TypeError && accessed;
+ }
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce) && fnExists(Object.defineProperty);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-5-1.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-5-1.js
new file mode 100644
index 000000000..4dcbf2048
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-5-1.js
@@ -0,0 +1,46 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest( {
+id: "15.4.4.21-5-1",
+
+path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-5-1.js",
+
+description: "Array.prototype.reduce throws TypeError if 'length' is 0 (empty array), no initVal",
+
+test: function testcase() {
+ function cb(){}
+
+ try {
+ [].reduce(cb);
+ }
+ catch (e) {
+ if (e instanceof TypeError) {
+ return true;
+ }
+ }
+ },
+
+precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-5-10.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-5-10.js
new file mode 100644
index 000000000..70771b5b8
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-5-10.js
@@ -0,0 +1,61 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-5-10",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-5-10.js",
+
+ description: "Array.prototype.reduce - if exception occurs, it occurs after any side-effects that might be produced by step 2",
+
+ test: function testcase() {
+
+ function callbackfn(prevVal, curVal, idx, obj) {
+ return (curVal > 10);
+ }
+
+ var obj = { 0: 11, 1: 12 };
+
+ var accessed = false;
+
+ Object.defineProperty(obj, "length", {
+ get: function () {
+ accessed = true;
+ return 0;
+ },
+ configurable: true
+ });
+
+ try {
+ Array.prototype.reduce.call(obj, callbackfn);
+ return false;
+ } catch (ex) {
+ return (ex instanceof TypeError) && accessed;
+ }
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce) && fnExists(Object.defineProperty);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-5-11.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-5-11.js
new file mode 100644
index 000000000..cdf41bb3d
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-5-11.js
@@ -0,0 +1,65 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-5-11",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-5-11.js",
+
+ description: "Array.prototype.reduce - if the exception occurs, it occurs after any side-effects that might be produced by step 3",
+
+ test: function testcase() {
+
+ function callbackfn(prevVal, curVal, idx, obj) {
+ return (curVal > 10);
+ }
+
+ var obj = { 0: 11, 1: 12 };
+
+ var accessed = false;
+
+ Object.defineProperty(obj, "length", {
+ get: function () {
+ return {
+ toString: function () {
+ accessed = true;
+ return "0";
+ }
+ };
+ },
+ configurable: true
+ });
+
+ try {
+ Array.prototype.reduce.call(obj, callbackfn);
+ return false;
+ } catch (ex) {
+ return (ex instanceof TypeError) && accessed;
+ }
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce) && fnExists(Object.defineProperty);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-5-12.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-5-12.js
new file mode 100644
index 000000000..db46fd6c7
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-5-12.js
@@ -0,0 +1,58 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-5-12",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-5-12.js",
+
+ description: "Array.prototype.reduce - the exception is not thrown if exception was thrown by step 2",
+
+ test: function testcase() {
+
+ function callbackfn(prevVal, curVal, idx, obj) {
+ return (curVal > 10);
+ }
+
+ var obj = { 0: 11, 1: 12 };
+
+ Object.defineProperty(obj, "length", {
+ get: function () {
+ throw new SyntaxError();
+ },
+ configurable: true
+ });
+
+ try {
+ Array.prototype.reduce.call(obj, callbackfn);
+ return false;
+ } catch (ex) {
+ return !(ex instanceof TypeError);
+ }
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce) && fnExists(Object.defineProperty);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-5-13.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-5-13.js
new file mode 100644
index 000000000..2a93dfbcd
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-5-13.js
@@ -0,0 +1,63 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-5-13",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-5-13.js",
+
+ description: "Array.prototype.reduce - the exception is not thrown if exception was thrown by step 3",
+
+ test: function testcase() {
+
+ function callbackfn(prevVal, curVal, idx, obj) {
+ return (curVal > 10);
+ }
+
+ var obj = { 0: 11, 1: 12 };
+
+ Object.defineProperty(obj, "length", {
+ get: function () {
+ return {
+ toString: function () {
+ throw new SyntaxError();
+ }
+ };
+ },
+ configurable: true
+ });
+
+
+ try {
+ Array.prototype.reduce.call(obj, callbackfn);
+ return false;
+ } catch (ex) {
+ return !(ex instanceof TypeError);
+ }
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce) && fnExists(Object.defineProperty);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-5-2.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-5-2.js
new file mode 100644
index 000000000..98f0372ca
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-5-2.js
@@ -0,0 +1,50 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest( {
+id: "15.4.4.21-5-2",
+
+path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-5-2.js",
+
+description: "Array.prototype.reduce throws TypeError if 'length' is 0 (subclassed Array, length overridden to null (type conversion)), no initVal",
+
+test: function testcase() {
+ foo.prototype = new Array(1, 2, 3);
+ function foo() {}
+ var f = new foo();
+ f.length = null;
+
+ function cb(){}
+ try {
+ f.reduce(cb);
+ }
+ catch (e) {
+ if (e instanceof TypeError) {
+ return true;
+ }
+ }
+ },
+
+precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-5-3.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-5-3.js
new file mode 100644
index 000000000..7b3777092
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-5-3.js
@@ -0,0 +1,50 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest( {
+id: "15.4.4.21-5-3",
+
+path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-5-3.js",
+
+description: "Array.prototype.reduce throws TypeError if 'length' is 0 (subclassed Array, length overridden to false (type conversion)), no initVal",
+
+test: function testcase() {
+ foo.prototype = new Array(1, 2, 3);
+ function foo() {}
+ var f = new foo();
+ f.length = false;
+
+ function cb(){}
+ try {
+ f.reduce(cb);
+ }
+ catch (e) {
+ if (e instanceof TypeError) {
+ return true;
+ }
+ }
+ },
+
+precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-5-4.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-5-4.js
new file mode 100644
index 000000000..0f439f42d
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-5-4.js
@@ -0,0 +1,50 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest( {
+id: "15.4.4.21-5-4",
+
+path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-5-4.js",
+
+description: "Array.prototype.reduce throws TypeError if 'length' is 0 (subclassed Array, length overridden to 0 (type conversion)), no initVal",
+
+test: function testcase() {
+ foo.prototype = new Array(1, 2, 3);
+ function foo() {}
+ var f = new foo();
+ f.length = 0;
+
+ function cb(){}
+ try {
+ f.reduce(cb);
+ }
+ catch (e) {
+ if (e instanceof TypeError) {
+ return true;
+ }
+ }
+ },
+
+precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-5-5.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-5-5.js
new file mode 100644
index 000000000..71306e94f
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-5-5.js
@@ -0,0 +1,50 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest( {
+id: "15.4.4.21-5-5",
+
+path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-5-5.js",
+
+description: "Array.prototype.reduce throws TypeError if 'length' is 0 (subclassed Array, length overridden to '0' (type conversion)), no initVal",
+
+test: function testcase() {
+ foo.prototype = new Array(1, 2, 3);
+ function foo() {}
+ var f = new foo();
+ f.length = '0';
+
+ function cb(){}
+ try {
+ f.reduce(cb);
+ }
+ catch (e) {
+ if (e instanceof TypeError) {
+ return true;
+ }
+ }
+ },
+
+precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-5-6.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-5-6.js
new file mode 100644
index 000000000..f077a786d
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-5-6.js
@@ -0,0 +1,52 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest( {
+id: "15.4.4.21-5-6",
+
+path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-5-6.js",
+
+description: "Array.prototype.reduce throws TypeError if 'length' is 0 (subclassed Array, length overridden with obj with valueOf), no initVal",
+
+test: function testcase() {
+ foo.prototype = new Array(1, 2, 3);
+ function foo() {}
+ var f = new foo();
+
+ var o = { valueOf: function () { return 0;}};
+ f.length = o;
+
+ function cb(){}
+ try {
+ f.reduce(cb);
+ }
+ catch (e) {
+ if (e instanceof TypeError) {
+ return true;
+ }
+ }
+ },
+
+precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-5-7.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-5-7.js
new file mode 100644
index 000000000..ecd8f932e
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-5-7.js
@@ -0,0 +1,58 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest( {
+id: "15.4.4.21-5-7",
+
+path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-5-7.js",
+
+description: "Array.prototype.reduce throws TypeError if 'length' is 0 (subclassed Array, length overridden with obj w/o valueOf (toString)), no initVal",
+
+test: function testcase() {
+ foo.prototype = new Array(1, 2, 3);
+ function foo() {}
+ var f = new foo();
+
+ var o = { toString: function () { return '0';}};
+ f.length = o;
+
+ // objects inherit the default valueOf method of the Object object;
+ // that simply returns the itself. Since the default valueOf() method
+ // does not return a primitive value, ES next tries to convert the object
+ // to a number by calling its toString() method and converting the
+ // resulting string to a number.
+
+ function cb(){}
+ try {
+ f.reduce(cb);
+ }
+ catch (e) {
+ if (e instanceof TypeError) {
+ return true;
+ }
+ }
+ },
+
+precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-5-8.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-5-8.js
new file mode 100644
index 000000000..67044ee2a
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-5-8.js
@@ -0,0 +1,65 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest( {
+id: "15.4.4.21-5-8",
+
+path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-5-8.js",
+
+description: "Array.prototype.reduce throws TypeError if 'length' is 0 (subclassed Array, length overridden with []), no initVal",
+
+test: function testcase() {
+ foo.prototype = new Array(1, 2, 3);
+ function foo() {}
+ var f = new foo();
+
+ f.length = [];
+
+ // objects inherit the default valueOf method of the Object object;
+ // that simply returns the itself. Since the default valueOf() method
+ // does not return a primitive value, ES next tries to convert the object
+ // to a number by calling its toString() method and converting the
+ // resulting string to a number.
+ //
+ // The toString( ) method on Array converts the array elements to strings,
+ // then returns the result of concatenating these strings, with commas in
+ // between. An array with no elements converts to the empty string, which
+ // converts to the number 0. If an array has a single element that is a
+ // number n, the array converts to a string representation of n, which is
+ // then converted back to n itself. If an array contains more than one element,
+ // or if its one element is not a number, the array converts to NaN.
+
+ function cb(){}
+ try {
+ f.reduce(cb);
+ }
+ catch (e) {
+ if (e instanceof TypeError) {
+ return true;
+ }
+ }
+ },
+
+precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-5-9.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-5-9.js
new file mode 100644
index 000000000..e3a3ab738
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-5-9.js
@@ -0,0 +1,45 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-5-9",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-5-9.js",
+
+ description: "Array.prototype.reduce - 'initialValue' is returned if 'len' is 0 and 'initialValue' is present",
+
+ test: function testcase() {
+
+ var accessed = false;
+ function callbackfn(prevVal, curVal, idx, obj) {
+ accessed = true;
+ }
+
+ return [].reduce(callbackfn, 3) === 3 && !accessed;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-7-1.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-7-1.js
new file mode 100644
index 000000000..98e85a51b
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-7-1.js
@@ -0,0 +1,42 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.4.4.21-7-1",
+
+path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-7-1.js",
+
+description: "Array.prototype.reduce returns initialValue if 'length' is 0 and initialValue is present (empty array)",
+
+test: function testcase() {
+ function cb(){}
+
+ try {
+ if([].reduce(cb,1) === 1)
+ return true;
+ }
+ catch (e) { }
+ },
+
+precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-7-10.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-7-10.js
new file mode 100644
index 000000000..3c7a4b71a
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-7-10.js
@@ -0,0 +1,41 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-7-10",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-7-10.js",
+
+ description: "Array.prototype.reduce - 'initialValue' is present",
+
+ test: function testcase() {
+
+ var str = "initialValue is present";
+ return str === [].reduce(function () { }, str);
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-7-11.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-7-11.js
new file mode 100644
index 000000000..1719505ad
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-7-11.js
@@ -0,0 +1,41 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-7-11",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-7-11.js",
+
+ description: "Array.prototype.reduce - 'initialValue' is not present",
+
+ test: function testcase() {
+
+ var str = "initialValue is not present";
+ return str === [str].reduce(function () { });
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-7-2.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-7-2.js
new file mode 100644
index 000000000..d1627cf84
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-7-2.js
@@ -0,0 +1,46 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.4.4.21-7-2",
+
+path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-7-2.js",
+
+description: "Array.prototype.reduce returns initialValue if 'length' is 0 and initialValue is present (subclassed Array, length overridden to null (type conversion))",
+
+test: function testcase() {
+ foo.prototype = new Array(1, 2, 3);
+ function foo() {}
+ var f = new foo();
+ f.length = null;
+
+ function cb(){}
+ try {
+ if(f.reduce(cb,1) === 1)
+ return true;
+ }
+ catch (e) { }
+ },
+
+precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-7-3.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-7-3.js
new file mode 100644
index 000000000..bf9537d95
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-7-3.js
@@ -0,0 +1,46 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.4.4.21-7-3",
+
+path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-7-3.js",
+
+description: "Array.prototype.reduce returns initialValue if 'length' is 0 and initialValue is present (subclassed Array, length overridden to false (type conversion))",
+
+test: function testcase() {
+ foo.prototype = new Array(1, 2, 3);
+ function foo() {}
+ var f = new foo();
+ f.length = false;
+
+ function cb(){}
+ try {
+ if(f.reduce(cb,1) === 1)
+ return true;
+ }
+ catch (e) { }
+ },
+
+precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-7-4.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-7-4.js
new file mode 100644
index 000000000..ff198c69a
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-7-4.js
@@ -0,0 +1,46 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.4.4.21-7-4",
+
+path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-7-4.js",
+
+description: "Array.prototype.reduce returns initialValue if 'length' is 0 and initialValue is present (subclassed Array, length overridden to 0 (type conversion))",
+
+test: function testcase() {
+ foo.prototype = new Array(1, 2, 3);
+ function foo() {}
+ var f = new foo();
+ f.length = 0;
+
+ function cb(){}
+ try {
+ if(f.reduce(cb,1) === 1)
+ return true;
+ }
+ catch (e) { }
+ },
+
+precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-7-5.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-7-5.js
new file mode 100644
index 000000000..fc8335180
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-7-5.js
@@ -0,0 +1,46 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.4.4.21-7-5",
+
+path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-7-5.js",
+
+description: "Array.prototype.reduce returns initialValue if 'length' is 0 and initialValue is present (subclassed Array, length overridden to '0' (type conversion))",
+
+test: function testcase() {
+ foo.prototype = new Array(1, 2, 3);
+ function foo() {}
+ var f = new foo();
+ f.length = '0';
+
+ function cb(){}
+ try {
+ if(f.reduce(cb,1) === 1)
+ return true;
+ }
+ catch (e) { }
+ },
+
+precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-7-6.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-7-6.js
new file mode 100644
index 000000000..e81f617e4
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-7-6.js
@@ -0,0 +1,48 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.4.4.21-7-6",
+
+path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-7-6.js",
+
+description: "Array.prototype.reduce returns initialValue if 'length' is 0 and initialValue is present (subclassed Array, length overridden with obj with valueOf)",
+
+test: function testcase() {
+ foo.prototype = new Array(1, 2, 3);
+ function foo() {}
+ var f = new foo();
+
+ var o = { valueOf: function () { return 0;}};
+ f.length = o;
+
+ function cb(){}
+ try {
+ if(f.reduce(cb,1) === 1)
+ return true;
+ }
+ catch (e) { }
+ },
+
+precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-7-7.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-7-7.js
new file mode 100644
index 000000000..d2972ef28
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-7-7.js
@@ -0,0 +1,54 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.4.4.21-7-7",
+
+path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-7-7.js",
+
+description: "Array.prototype.reduce returns initialValue if 'length' is 0 and initialValue is present (subclassed Array, length overridden with obj w/o valueOf (toString))",
+
+test: function testcase() {
+ foo.prototype = new Array(1, 2, 3);
+ function foo() {}
+ var f = new foo();
+
+ var o = { toString: function () { return '0';}};
+ f.length = o;
+
+ // objects inherit the default valueOf method of the Object object;
+ // that simply returns the itself. Since the default valueOf() method
+ // does not return a primitive value, ES next tries to convert the object
+ // to a number by calling its toString() method and converting the
+ // resulting string to a number.
+
+ function cb(){}
+ try {
+ if(f.reduce(cb,1) === 1)
+ return true;
+ }
+ catch (e) { }
+ },
+
+precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-7-8.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-7-8.js
new file mode 100644
index 000000000..ea2c984dc
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-7-8.js
@@ -0,0 +1,61 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.4.4.21-7-8",
+
+path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-7-8.js",
+
+description: "Array.prototype.reduce returns initialValue if 'length' is 0 and initialValue is present (subclassed Array, length overridden with [])",
+
+test: function testcase() {
+ foo.prototype = new Array(1, 2, 3);
+ function foo() {}
+ var f = new foo();
+
+ f.length = [];
+
+ // objects inherit the default valueOf method of the Object object;
+ // that simply returns the itself. Since the default valueOf() method
+ // does not return a primitive value, ES next tries to convert the object
+ // to a number by calling its toString() method and converting the
+ // resulting string to a number.
+ //
+ // The toString( ) method on Array converts the array elements to strings,
+ // then returns the result of concatenating these strings, with commas in
+ // between. An array with no elements converts to the empty string, which
+ // converts to the number 0. If an array has a single element that is a
+ // number n, the array converts to a string representation of n, which is
+ // then converted back to n itself. If an array contains more than one element,
+ // or if its one element is not a number, the array converts to NaN.
+
+ function cb(){}
+ try {
+ if(f.reduce(cb,1) === 1)
+ return true;
+ }
+ catch (e) { }
+ },
+
+precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-7-9.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-7-9.js
new file mode 100644
index 000000000..af884e15a
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-7-9.js
@@ -0,0 +1,61 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.4.4.21-7-9",
+
+path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-7-9.js",
+
+description: "Array.prototype.reduce returns initialValue if 'length' is 0 and initialValue is present (subclassed Array, length overridden with [0])",
+
+test: function testcase() {
+ foo.prototype = new Array(1, 2, 3);
+ function foo() {}
+ var f = new foo();
+
+ f.length = [0];
+
+ // objects inherit the default valueOf method of the Object object;
+ // that simply returns the itself. Since the default valueOf() method
+ // does not return a primitive value, ES next tries to convert the object
+ // to a number by calling its toString() method and converting the
+ // resulting string to a number.
+ //
+ // The toString( ) method on Array converts the array elements to strings,
+ // then returns the result of concatenating these strings, with commas in
+ // between. An array with no elements converts to the empty string, which
+ // converts to the number 0. If an array has a single element that is a
+ // number n, the array converts to a string representation of n, which is
+ // then converted back to n itself. If an array contains more than one element,
+ // or if its one element is not a number, the array converts to NaN.
+
+ function cb(){}
+ try {
+ if(f.reduce(cb,1) === 1)
+ return true;
+ }
+ catch (e) { }
+ },
+
+precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-1.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-1.js
new file mode 100644
index 000000000..1e16d10b8
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-1.js
@@ -0,0 +1,57 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-8-b-1",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-1.js",
+
+ description: "Array.prototype.reduce - no observable effects occur if 'len' is 0",
+
+ test: function testcase() {
+
+ var accessed = false;
+
+ var obj = { length: 0 };
+
+ Object.defineProperty(obj, "0", {
+ get: function () {
+ accessed = true;
+ return 10;
+ },
+ configurable: true
+ });
+
+ try {
+ Array.prototype.reduce.call(obj, function () { });
+ return false;
+ } catch (ex) {
+ return !accessed;
+ }
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce) && fnExists(Object.defineProperty) && fnSupportsArrayIndexGettersOnObjects();
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-2.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-2.js
new file mode 100644
index 000000000..47a61de1a
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-2.js
@@ -0,0 +1,54 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-8-b-2",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-2.js",
+
+ description: "Array.prototype.reduce - modifications to length don't change number of iterations in step 9",
+
+ test: function testcase() {
+
+ function callbackfn(prevVal, curVal, idx, obj) {
+ return idx;
+ }
+
+ var obj = { 3: 12, 4: 9, length: 4 };
+
+ Object.defineProperty(obj, "2", {
+ get: function () {
+ obj.length = 10;
+ return 11;
+ },
+ configurable: true
+ });
+
+ return Array.prototype.reduce.call(obj, callbackfn) === 3;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce) && fnExists(Object.defineProperty) && fnSupportsArrayIndexGettersOnObjects();
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-3.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-3.js
new file mode 100644
index 000000000..99b10c692
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-3.js
@@ -0,0 +1,71 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-8-b-3",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-3.js",
+
+ description: "Array.prototype.reduce - loop is broken once 'kPresent' is true",
+
+ test: function testcase() {
+
+ var called = 0;
+ var testResult = false;
+ var firstCalled = 0;
+ var secondCalled = 0;
+
+ function callbackfn(prevVal, val, idx, obj) {
+ if (called === 0) {
+ testResult = (idx === 1);
+ }
+ called++;
+ }
+
+ var arr = [, , ];
+
+ Object.defineProperty(arr, "0", {
+ get: function () {
+ firstCalled++;
+ return 11;
+ },
+ configurable: true
+ });
+
+ Object.defineProperty(arr, "1", {
+ get: function () {
+ secondCalled++;
+ return 9;
+ },
+ configurable: true
+ });
+
+ arr.reduce(callbackfn);
+ return testResult && firstCalled === 1 && secondCalled === 1;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce) && fnExists(Object.defineProperty) && fnSupportsArrayIndexGettersOnArrays();
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-ii-1.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-ii-1.js
new file mode 100644
index 000000000..2e49f8644
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-ii-1.js
@@ -0,0 +1,49 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-8-b-ii-1",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-ii-1.js",
+
+ description: "Array.prototype.reduce - added properties in step 2 are visible here",
+
+ test: function testcase() {
+
+ var obj = { };
+
+ Object.defineProperty(obj, "length", {
+ get: function () {
+ obj[1] = "accumulator";
+ return 3;
+ },
+ configurable: true
+ });
+
+ return Array.prototype.reduce.call(obj, function () { }) === "accumulator";
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce) && fnExists(Object.defineProperty);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-ii-2.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-ii-2.js
new file mode 100644
index 000000000..e6bc95bc3
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-ii-2.js
@@ -0,0 +1,50 @@
+/// Copyright (c) 2009 Microsoft Corporation
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-8-b-ii-2",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-ii-2.js",
+
+ description: "Array.prototype.reduce - deleted properties in step 2 are visible here",
+
+ test: function testcase() {
+
+ var obj = { 1: "accumulator", 2: "another" };
+
+ Object.defineProperty(obj, "length", {
+ get: function () {
+ delete obj[1];
+ return 3;
+ },
+ configurable: true
+ });
+
+ return "accumulator" !== Array.prototype.reduce.call(obj, function () { });
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce) && fnExists(Object.defineProperty);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-1.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-1.js
new file mode 100644
index 000000000..63f4f126c
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-1.js
@@ -0,0 +1,47 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-8-b-iii-1-1",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-1.js",
+
+ description: "Array.prototype.reduce - element to be retrieved is own data property on an Array-like object",
+
+ test: function testcase() {
+
+ var testResult = false;
+ function callbackfn(prevVal, curVal, idx, obj) {
+ if (idx === 1) {
+ testResult = (prevVal === 0);
+ }
+ }
+
+ var obj = { 0: 0, 1: 1, 2: 2, length: 2 };
+ Array.prototype.reduce.call(obj, callbackfn);
+ return testResult;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-10.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-10.js
new file mode 100644
index 000000000..7437aeec6
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-10.js
@@ -0,0 +1,57 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-8-b-iii-1-10",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-10.js",
+
+ description: "Array.prototype.reduce - when element to be retrieved is own accessor property on an Array",
+
+ test: function testcase() {
+ var testResult = false;
+
+ function callbackfn(prevVal, curVal, idx, obj) {
+ if (idx === 1) {
+ testResult = (prevVal === 0);
+ }
+ }
+
+ var arr = [, 1, 2];
+
+ Object.defineProperty(arr, "0", {
+ get: function () {
+ return 0;
+ },
+ configurable: true
+ });
+
+ arr.reduce(callbackfn);
+ return testResult;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce) && fnExists(Object.defineProperty) && fnSupportsArrayIndexGettersOnArrays();
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-11.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-11.js
new file mode 100644
index 000000000..09422636b
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-11.js
@@ -0,0 +1,63 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-8-b-iii-1-11",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-11.js",
+
+ description: "Array.prototype.reduce - element to be retrieved is own accessor property that overrides an inherited data property on an Array-like object",
+
+ test: function testcase() {
+
+ var testResult = false;
+ function callbackfn(prevVal, curVal, idx, obj) {
+ if (idx === 1) {
+ testResult = (prevVal === "9");
+ }
+ }
+
+ var proto = { 0: 0, 1: 1, 2: 2 };
+
+ var Con = function () { };
+ Con.prototype = proto;
+
+ var child = new Con();
+ child.length = 3;
+
+ Object.defineProperty(child, "0", {
+ get: function () {
+ return "9";
+ },
+ configurable: true
+ });
+
+ Array.prototype.reduce.call(child, callbackfn);
+ return testResult;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce) && fnExists(Object.defineProperty) && fnSupportsArrayIndexGettersOnObjects();
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-12.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-12.js
new file mode 100644
index 000000000..03bcb0ffe
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-12.js
@@ -0,0 +1,62 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-8-b-iii-1-12",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-12.js",
+
+ description: "Array.prototype.reduce - element to be retrieved is own accessor property that overrides an inherited data property on an Array",
+
+ test: function testcase() {
+ var testResult = false;
+
+ function callbackfn(prevVal, curVal, idx, obj) {
+ if (idx === 1) {
+ testResult = (prevVal === "9");
+ }
+ }
+
+ try {
+ Array.prototype[0] = 0;
+ var arr = [, 1, 2];
+
+ Object.defineProperty(arr, "0", {
+ get: function () {
+ return "9";
+ },
+ configurable: true
+ });
+
+ arr.reduce(callbackfn);
+ return testResult;
+ } finally {
+ delete Array.prototype[0];
+ }
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce) && fnExists(Object.defineProperty) && fnSupportsArrayIndexGettersOnArrays();
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-13.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-13.js
new file mode 100644
index 000000000..d0524d263
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-13.js
@@ -0,0 +1,69 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-8-b-iii-1-13",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-13.js",
+
+ description: "Array.prototype.reduce - element to be retrieved is own accessor property that overrides an inherited accessor property on an Array-like object",
+ test: function testcase() {
+ var testResult = false;
+
+ function callbackfn(prevVal, curVal, idx, obj) {
+ if (idx === 1) {
+ testResult = (prevVal === "9");
+ }
+ }
+
+ var proto = { 1: 1, 2: 2};
+
+ Object.defineProperty(proto, "0", {
+ get: function () {
+ return 0;
+ },
+ configurable: true
+ });
+
+ var Con = function () { };
+ Con.prototype = proto;
+
+ var child = new Con();
+ child.length = 3;
+
+ Object.defineProperty(child, "0", {
+ get: function () {
+ return "9";
+ },
+ configurable: true
+ });
+
+ Array.prototype.reduce.call(child, callbackfn);
+ return testResult;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce) && fnExists(Object.defineProperty) && fnSupportsArrayIndexGettersOnObjects();
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-14.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-14.js
new file mode 100644
index 000000000..6444894aa
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-14.js
@@ -0,0 +1,67 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-8-b-iii-1-14",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-14.js",
+
+ description: "Array.prototype.reduce - element to be retrieved is own accessor property that overrides an inherited accessor property on an Array",
+
+ test: function testcase() {
+
+ var testResult = false;
+ function callbackfn(prevVal, curVal, idx, obj) {
+ if (idx === 1) {
+ testResult = (prevVal === "9");
+ }
+ }
+
+ try {
+ Object.defineProperty(Array.prototype, "0", {
+ get: function () {
+ return 0;
+ },
+ configurable: true
+ });
+
+ var arr = [, 1, 2];
+ Object.defineProperty(arr, "0", {
+ get: function () {
+ return "9";
+ },
+ configurable: true
+ });
+
+ arr.reduce(callbackfn);
+ return testResult;
+ } finally {
+ delete Array.prototype[0];
+ }
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce) && fnExists(Object.defineProperty) && fnSupportsArrayIndexGettersOnArrays();
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-15.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-15.js
new file mode 100644
index 000000000..c6c99aba9
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-15.js
@@ -0,0 +1,63 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-8-b-iii-1-15",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-15.js",
+
+ description: "Array.prototype.reduce - element to be retrieved is inherited accessor property on an Array-like object",
+
+ test: function testcase() {
+
+ var testResult = false;
+ function callbackfn(prevVal, curVal, idx, obj) {
+ if (idx === 1) {
+ testResult = (prevVal === 0);
+ }
+ }
+
+ var proto = { 1: 1, 2: 2 };
+
+ Object.defineProperty(proto, "0", {
+ get: function () {
+ return 0;
+ },
+ configurable: true
+ });
+
+ var Con = function () { };
+ Con.prototype = proto;
+
+ var child = new Con();
+ child.length = 3;
+
+ Array.prototype.reduce.call(child, callbackfn);
+ return testResult;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce) && fnExists(Object.defineProperty) && fnSupportsArrayIndexGettersOnObjects();
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-16.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-16.js
new file mode 100644
index 000000000..6bea23e0f
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-16.js
@@ -0,0 +1,60 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-8-b-iii-1-16",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-16.js",
+
+ description: "Array.prototype.reduce - element to be retrieved is inherited accessor property on an Array",
+
+ test: function testcase() {
+
+ var testResult = false;
+ function callbackfn(prevVal, curVal, idx, obj) {
+ if (idx === 1) {
+ testResult = (prevVal === 0);
+ }
+ }
+
+ try {
+ Object.defineProperty(Array.prototype, "0", {
+ get: function () {
+ return 0;
+ },
+ configurable: true
+ });
+
+ var arr = [, 1, 2];
+
+ arr.reduce(callbackfn);
+ return testResult;
+ } finally {
+ delete Array.prototype[0];
+ }
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce) && fnExists(Object.defineProperty) && ![, 1].hasOwnProperty(0) && fnSupportsArrayIndexGettersOnArrays();
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-17.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-17.js
new file mode 100644
index 000000000..650ecae25
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-17.js
@@ -0,0 +1,55 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-8-b-iii-1-17",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-17.js",
+
+ description: "Array.prototype.reduce - element to be retrieved is own accessor property without a get function on an Array-like object",
+
+ test: function testcase() {
+
+ var testResult = false;
+ function callbackfn(prevVal, curVal, idx, obj) {
+ if (idx === 1) {
+ testResult = (prevVal === undefined);
+ }
+ }
+
+ var obj = { 1: 1, 2: 2, length: 3 };
+
+ Object.defineProperty(obj, "0", {
+ set: function () { },
+ configurable: true
+ });
+
+ Array.prototype.reduce.call(obj, callbackfn);
+ return testResult;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce) && fnExists(Object.defineProperty) && fnSupportsArrayIndexGettersOnObjects();
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-18.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-18.js
new file mode 100644
index 000000000..4143da2c1
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-18.js
@@ -0,0 +1,55 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-8-b-iii-1-18",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-18.js",
+
+ description: "Array.prototype.reduce - element to be retrieved is own accessor property without a get function on an Array",
+
+ test: function testcase() {
+
+ var testResult = false;
+ function callbackfn(prevVal, curVal, idx, obj) {
+ if (idx === 1) {
+ testResult = (prevVal === undefined);
+ }
+ }
+
+ var arr = [, 1, 2];
+
+ Object.defineProperty(arr, "0", {
+ set: function () { },
+ configurable: true
+ });
+
+ arr.reduce(callbackfn);
+ return testResult;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce) && fnExists(Object.defineProperty) && fnSupportsArrayIndexGettersOnArrays();
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-19.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-19.js
new file mode 100644
index 000000000..916a4a34e
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-19.js
@@ -0,0 +1,61 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-8-b-iii-1-19",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-19.js",
+
+ description: "Array.prototype.reduce - element to be retrieved is own accessor property without a get function that overrides an inherited accessor property on an Array-like object",
+
+ test: function testcase() {
+
+ var testResult = false;
+ function callbackfn(prevVal, curVal, idx, obj) {
+ if (idx === 1) {
+ testResult = (prevVal === undefined);
+ }
+ }
+
+ try {
+ Object.prototype[0] = 0;
+
+ var obj = { 1: 1, 2: 2, length: 3 };
+
+ Object.defineProperty(obj, "0", {
+ set: function () { },
+ configurable: true
+ });
+
+ Array.prototype.reduce.call(obj, callbackfn);
+ return testResult;
+ } finally {
+ delete Object.prototype[0];
+ }
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce) && fnExists(Object.defineProperty) && fnSupportsArrayIndexGettersOnObjects();
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-2.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-2.js
new file mode 100644
index 000000000..79e67f750
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-2.js
@@ -0,0 +1,48 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-8-b-iii-1-2",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-2.js",
+
+ description: "Array.prototype.reduce - element to be retrieved is own data property on an Array",
+
+ test: function testcase() {
+
+ var testResult = false;
+ function callbackfn(prevVal, curVal, idx, obj) {
+ if (idx === 1) {
+ testResult = (prevVal === 0);
+ }
+ }
+
+ var arr = [0, 1, 2];
+ arr.reduce(callbackfn);
+ return testResult;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-20.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-20.js
new file mode 100644
index 000000000..40608c375
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-20.js
@@ -0,0 +1,60 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-8-b-iii-1-20",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-20.js",
+
+ description: "Array.prototype.reduce - element to be retrieved is own accessor property without a get function that overrides an inherited accessor property on an Array",
+
+ test: function testcase() {
+
+ var testResult = false;
+ function callbackfn(prevVal, curVal, idx, obj) {
+ if (idx === 1) {
+ testResult = (prevVal === undefined);
+ }
+ }
+
+ try {
+ Array.prototype[0] = 0;
+ var arr = [, 1, 2];
+ Object.defineProperty(arr, "0", {
+ set: function () { },
+ configurable: true
+ });
+
+ arr.reduce(callbackfn);
+ return testResult;
+
+ } finally {
+ delete Array.prototype[0];
+ }
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce) && fnExists(Object.defineProperty) && fnSupportsArrayIndexGettersOnArrays();
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-21.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-21.js
new file mode 100644
index 000000000..eee30c9be
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-21.js
@@ -0,0 +1,60 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-8-b-iii-1-21",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-21.js",
+
+ description: "Array.prototype.reduce - element to be retrieved is inherited accessor property without a get function on an Array-like object",
+
+ test: function testcase() {
+
+ var testResult = false;
+ function callbackfn(prevVal, curVal, idx, obj) {
+ if (idx === 1) {
+ testResult = (prevVal === undefined);
+ }
+ }
+
+ var proto = { 1: 1, 2: 2 };
+
+ Object.defineProperty(proto, "0", {
+ set: function () { },
+ configurable: true
+ });
+
+ var Con = function () { };
+ Con.prototype = proto;
+
+ var child = new Con();
+ child.length = 3;
+
+ Array.prototype.reduce.call(child, callbackfn);
+ return testResult;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce) && fnExists(Object.defineProperty) && fnSupportsArrayIndexGettersOnObjects();
+ }
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-22.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-22.js
new file mode 100644
index 000000000..09ab41ce2
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-22.js
@@ -0,0 +1,61 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-8-b-iii-1-22",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-22.js",
+
+ description: "Array.prototype.reduce - element to be retrieved is inherited accessor property without a get function on an Array",
+
+ test: function testcase() {
+
+ var testResult = false;
+ function callbackfn(prevVal, curVal, idx, obj) {
+ if (idx === 1) {
+ testResult = (prevVal === undefined);
+ }
+ }
+
+ try {
+ Object.defineProperty(Array.prototype, "0", {
+ set: function () { },
+ configurable: true
+ });
+
+ var arr = [, 1, 2];
+
+ arr.reduce(callbackfn);
+ return testResult;
+
+ } finally {
+ delete Array.prototype[0];
+ }
+
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce) && fnExists(Object.defineProperty) && ![, 1].hasOwnProperty(0) && fnSupportsArrayIndexGettersOnArrays();
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-23.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-23.js
new file mode 100644
index 000000000..b685e4329
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-23.js
@@ -0,0 +1,61 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-8-b-iii-1-23",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-23.js",
+
+ description: "Array.prototype.reduce - This object is the global object which contains index property",
+
+ test: function testcase() {
+
+ var testResult = false;
+ function callbackfn(prevVal, curVal, idx, obj) {
+ if (idx === 1) {
+ testResult = (prevVal === 0);
+ }
+ }
+
+ try {
+ var oldLen = fnGlobalObject().length;
+ fnGlobalObject()[0] = 0;
+ fnGlobalObject()[1] = 1;
+ fnGlobalObject()[2] = 2;
+ fnGlobalObject().length = 3;
+
+ Array.prototype.reduce.call(fnGlobalObject(), callbackfn);
+ return testResult;
+
+ } finally {
+ delete fnGlobalObject()[0];
+ delete fnGlobalObject()[1];
+ delete fnGlobalObject()[2];
+ fnGlobalObject().length = oldLen;
+ }
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-25.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-25.js
new file mode 100644
index 000000000..b498181b2
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-25.js
@@ -0,0 +1,52 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-8-b-iii-1-25",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-25.js",
+
+ description: "Array.prototype.reduce - This object is the Arguments object which implements its own property get method (number of arguments is less than number of parameters)",
+
+ test: function testcase() {
+
+ var testResult = false;
+ function callbackfn(prevVal, curVal, idx, obj) {
+ if (idx === 1) {
+ testResult = (prevVal === 0);
+ }
+ }
+
+ var func = function (a, b, c) {
+ Array.prototype.reduce.call(arguments, callbackfn);
+ };
+
+ func(0, 1);
+ return testResult;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-26.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-26.js
new file mode 100644
index 000000000..1c1636709
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-26.js
@@ -0,0 +1,53 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-8-b-iii-1-26",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-26.js",
+
+ description: "Array.prototype.reduce - This object is the Arguments object which implements its own property get method (number of arguments equals number of parameters)",
+
+ test: function testcase() {
+
+ var testResult = false;
+ function callbackfn(prevVal, curVal, idx, obj) {
+ if (idx === 2) {
+ testResult = (prevVal === 1);
+ }
+ }
+
+ var func = function (a, b, c) {
+ delete arguments[0];
+ Array.prototype.reduce.call(arguments, callbackfn);
+ };
+
+ func(0, 1, 2);
+ return testResult;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-27.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-27.js
new file mode 100644
index 000000000..8f556682e
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-27.js
@@ -0,0 +1,54 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-8-b-iii-1-27",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-27.js",
+
+ description: "Array.prototype.reduce - This object is the Arguments object which implements its own property get method (number of arguments is greater than number of parameters)",
+
+ test: function testcase() {
+
+ var testResult = false;
+ function callbackfn(prevVal, curVal, idx, obj) {
+ if (idx === 3) {
+ testResult = (prevVal === 2);
+ }
+ }
+
+ var func = function (a, b, c) {
+ delete arguments[0];
+ delete arguments[1];
+ Array.prototype.reduce.call(arguments, callbackfn);
+ };
+
+ func(0, 1, 2, 3);
+ return testResult;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-28.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-28.js
new file mode 100644
index 000000000..45324a6ac
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-28.js
@@ -0,0 +1,50 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-8-b-iii-1-28",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-28.js",
+
+ description: "Array.prototype.reduce - applied to String object, which implements its own property get method",
+
+ test: function testcase() {
+
+ var testResult = false;
+ function callbackfn(prevVal, curVal, idx, obj) {
+ if (idx === 1) {
+ testResult = (prevVal === "0");
+ }
+ }
+
+ var str = new String("012");
+ Array.prototype.reduce.call(str, callbackfn);
+ return testResult;
+
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-29.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-29.js
new file mode 100644
index 000000000..0acf9f653
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-29.js
@@ -0,0 +1,57 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-8-b-iii-1-29",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-29.js",
+
+ description: "Array.prototype.reduce - applied to Function object which implements its own property get method",
+
+ test: function testcase() {
+
+ var testResult = false;
+ function callbackfn(prevVal, curVal, idx, obj) {
+ if (idx === 1) {
+ testResult = (prevVal === 0);
+ }
+ }
+
+ var obj = function (a, b, c) {
+ return a + b + c;
+ };
+ obj[0] = 0;
+ obj[1] = 1;
+ obj[2] = 2;
+ obj[3] = 3;
+
+ Array.prototype.reduce.call(obj, callbackfn);
+ return testResult;
+
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-3.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-3.js
new file mode 100644
index 000000000..1e42d1ae8
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-3.js
@@ -0,0 +1,57 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-8-b-iii-1-3",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-3.js",
+
+ description: "Array.prototype.reduce - element to be retrieved is own data property that overrides an inherited data property on an Array-like object",
+
+ test: function testcase() {
+
+ var testResult = false;
+ function callbackfn(prevVal, curVal, idx, obj) {
+ if (idx === 1) {
+ testResult = (prevVal === "9");
+ }
+ }
+
+ var proto = { 0: 0, 1: 1, 2: 2, length: 3 };
+ var Con = function () { };
+ Con.prototype = proto;
+
+ var child = new Con();
+ child[0] = "9";
+ child[1] = "1";
+ child.length = 3;
+
+ Array.prototype.reduce.call(child, callbackfn);
+ return testResult;
+
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-30.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-30.js
new file mode 100644
index 000000000..4056e4143
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-30.js
@@ -0,0 +1,70 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-8-b-iii-1-30",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-30.js",
+
+ description: "Array.prototype.reduce - element changed by getter on current iterations is observed in subsequent iterations on an Array",
+
+ test: function testcase() {
+
+ var testResult = false;
+ function callbackfn(prevVal, curVal, idx, obj) {
+ if (idx === 1) {
+ testResult = (curVal === 1);
+ }
+ }
+
+ var arr = [, , 2];
+ var preIterVisible = false;
+
+ Object.defineProperty(arr, "0", {
+ get: function () {
+ preIterVisible = true;
+ return 0;
+ },
+ configurable: true
+ });
+
+ Object.defineProperty(arr, "1", {
+ get: function () {
+ if (preIterVisible) {
+ return 1;
+ } else {
+ return 100;
+ }
+ },
+ configurable: true
+ });
+
+ arr.reduce(callbackfn);
+ return testResult;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce) && fnExists(Object.defineProperty) && fnSupportsArrayIndexGettersOnArrays();
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-31.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-31.js
new file mode 100644
index 000000000..8008ba0d4
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-31.js
@@ -0,0 +1,71 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-8-b-iii-1-31",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-31.js",
+
+ description: "Array.prototype.reduce - element changed by getter on current iterations is observed in subsequent iterations on an Array-like object",
+
+ test: function testcase() {
+
+ var testResult = false;
+ function callbackfn(prevVal, curVal, idx, obj) {
+ if (idx === 1) {
+ testResult = (curVal === 1);
+ }
+ }
+
+ var obj = { length: 2 };
+ var preIterVisible = false;
+
+ Object.defineProperty(obj, "0", {
+ get: function () {
+ preIterVisible = true;
+ return 0;
+ },
+ configurable: true
+ });
+
+ Object.defineProperty(obj, "1", {
+ get: function () {
+ if (preIterVisible) {
+ return 1;
+ } else {
+ return 100;
+ }
+ },
+ configurable: true
+ });
+
+ Array.prototype.reduce.call(obj, callbackfn);
+ return testResult;
+
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce) && fnExists(Object.defineProperty) && fnSupportsArrayIndexGettersOnObjects();
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-32.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-32.js
new file mode 100644
index 000000000..e48807095
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-32.js
@@ -0,0 +1,62 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-8-b-iii-1-32",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-32.js",
+
+ description: "Array.prototype.reduce - exception in getter terminates iteration on an Array-like object",
+
+ test: function testcase() {
+
+ var accessed = false;
+ var testResult = false;
+ function callbackfn(prevVal, curVal, idx, obj) {
+ if (idx >= 1) {
+ accessed = true;
+ testResult = (prevVal === 0);
+ }
+ }
+
+ var obj = { 2: 2, 1: 1, length: 3 };
+ Object.defineProperty(obj, "0", {
+ get: function () {
+ throw new RangeError("unhandle exception happened in getter");
+ },
+ configurable: true
+ });
+
+ try {
+ Array.prototype.reduce.call(obj, callbackfn);
+ return false;
+ } catch (ex) {
+ return (ex instanceof RangeError) && !accessed && !testResult;
+ }
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce) && fnExists(Object.defineProperty) && fnSupportsArrayIndexGettersOnObjects();
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-33.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-33.js
new file mode 100644
index 000000000..8433a8d68
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-33.js
@@ -0,0 +1,63 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-8-b-iii-1-33",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-33.js",
+
+ description: "Array.prototype.reduce - exception in getter terminates iteration on an Array",
+
+ test: function testcase() {
+
+ var accessed = false;
+ var testResult = false;
+ function callbackfn(prevVal, curVal, idx, obj) {
+ if (idx >= 1) {
+ accessed = true;
+ testResult = (prevVal === 0);
+ }
+ }
+
+ var arr = [, 1, 2];
+
+ Object.defineProperty(arr, "0", {
+ get: function () {
+ throw new RangeError("unhandle exception happened in getter");
+ },
+ configurable: true
+ });
+
+ try {
+ arr.reduce(callbackfn);
+ return false;
+ } catch (ex) {
+ return (ex instanceof RangeError) && !accessed && !testResult;
+ }
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce) && fnExists(Object.defineProperty) && fnSupportsArrayIndexGettersOnArrays();
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-4.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-4.js
new file mode 100644
index 000000000..13829dc9c
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-4.js
@@ -0,0 +1,54 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-8-b-iii-1-4",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-4.js",
+
+ description: "Array.prototype.reduce - element to be retrieved is own data property that overrides an inherited data property on an Array",
+
+ test: function testcase() {
+
+ var testResult = false;
+ function callbackfn(prevVal, curVal, idx, obj) {
+ if (idx === 1) {
+ testResult = (prevVal === 0);
+ }
+ }
+
+ try {
+ Array.prototype[0] = "9";
+ [0, 1, 2].reduce(callbackfn);
+ return testResult;
+
+ } finally {
+ delete Array.prototype[0];
+ }
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-5.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-5.js
new file mode 100644
index 000000000..aa776aa28
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-5.js
@@ -0,0 +1,68 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-8-b-iii-1-5",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-5.js",
+
+ description: "Array.prototype.reduce - element to be retrieved is own data property that overrides an inherited accessor property on an Array-like object",
+
+ test: function testcase() {
+
+ var testResult = false;
+ function callbackfn(prevVal, curVal, idx, obj) {
+ if (idx === 1) {
+ testResult = (prevVal === "9");
+ }
+ }
+
+ var proto = {};
+
+ Object.defineProperty(proto, "0", {
+ get: function () {
+ return 0;
+ },
+ configurable: true
+ });
+
+ var Con = function () { };
+ Con.prototype = proto;
+
+ var child = new Con();
+ child.length = 2;
+ Object.defineProperty(child, "0", {
+ value: "9",
+ configurable: true
+ });
+ child[1] = "1";
+
+ Array.prototype.reduce.call(child, callbackfn);
+ return testResult;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce) && fnExists(Object.defineProperty) && fnSupportsArrayIndexGettersOnObjects();
+ }
+
+}); \ No newline at end of file
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-6.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-6.js
new file mode 100644
index 000000000..188fa4a2a
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-6.js
@@ -0,0 +1,59 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-8-b-iii-1-6",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-6.js",
+
+ description: "Array.prototype.reduce - element to be retrieved is own data property that overrides an inherited accessor property on an Array",
+
+ test: function testcase() {
+
+ var testResult = false;
+ function callbackfn(prevVal, curVal, idx, obj) {
+ if (idx === 1) {
+ testResult = (prevVal === 0);
+ }
+ }
+
+ try {
+ Object.defineProperty(Array.prototype, "0", {
+ get: function () {
+ return "5";
+ },
+ configurable: true
+ });
+
+ [0, 1, 2].reduce(callbackfn);
+ return testResult;
+ } finally {
+ delete Array.prototype[0];
+ }
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce) && fnExists(Object.defineProperty) && fnSupportsArrayIndexGettersOnArrays();
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-7.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-7.js
new file mode 100644
index 000000000..ed13875c4
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-7.js
@@ -0,0 +1,55 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-8-b-iii-1-7",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-7.js",
+
+ description: "Array.prototype.reduce - element to be retrieved is inherited data property on an Array-like object",
+
+ test: function testcase() {
+
+ var testResult = false;
+ function callbackfn(prevVal, curVal, idx, obj) {
+ if (idx === 1) {
+ testResult = (prevVal === 0);
+ }
+ }
+
+ var proto = { 0: 0, 1: 1, 2: 2, length: 3 };
+ var Con = function () { };
+ Con.prototype = proto;
+
+ var child = new Con();
+ child.length = 3;
+
+ Array.prototype.reduce.call(child, callbackfn);
+ return testResult;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-8.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-8.js
new file mode 100644
index 000000000..3333459a9
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-8.js
@@ -0,0 +1,57 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-8-b-iii-1-8",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-8.js",
+
+ description: "Array.prototype.reduce - element to be retrieved is inherited data property on an Array",
+
+ test: function testcase() {
+
+ var testResult = false;
+ function callbackfn(prevVal, curVal, idx, obj) {
+ if (idx === 1) {
+ testResult = (prevVal === 0);
+ }
+ }
+
+ try {
+ Array.prototype[0] = 0;
+ Array.prototype[1] = 1;
+ Array.prototype[2] = 2;
+ [, , ,].reduce(callbackfn);
+ return testResult;
+ } finally {
+ delete Array.prototype[0];
+ delete Array.prototype[1];
+ delete Array.prototype[2];
+ }
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce) && ![, 1].hasOwnProperty(0);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-9.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-9.js
new file mode 100644
index 000000000..2eddcfec4
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-9.js
@@ -0,0 +1,56 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-8-b-iii-1-9",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-b-iii-1-9.js",
+
+ description: "Array.prototype.reduce - element to be retrieved is own accessor property on an Array-like object",
+
+ test: function testcase() {
+
+ var testResult = false;
+ function callbackfn(prevVal, curVal, idx, obj) {
+ if (idx === 1) {
+ testResult = (prevVal === 0);
+ }
+ }
+
+ var obj = { 1: 1, 2: 2, length: 3 };
+ Object.defineProperty(obj, "0", {
+ get: function () {
+ return 0;
+ },
+ configurable: true
+ });
+
+ Array.prototype.reduce.call(obj, callbackfn);
+ return testResult;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce) && fnExists(Object.defineProperty) && fnSupportsArrayIndexGettersOnObjects();
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-c-1.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-c-1.js
new file mode 100644
index 000000000..666d05c43
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-c-1.js
@@ -0,0 +1,48 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.4.4.21-8-c-1",
+
+path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-c-1.js",
+
+description: "Array.prototype.reduce throws TypeError when Array is empty and initialValue is not present",
+
+test: function testcase() {
+
+ function callbackfn(prevVal, curVal, idx, obj)
+ {
+ }
+
+ var arr = new Array(10);
+ try {
+ arr.reduce(callbackfn);
+ }
+ catch(e) {
+ if(e instanceof TypeError)
+ return true;
+ }
+ },
+
+precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-c-2.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-c-2.js
new file mode 100644
index 000000000..87af7d08f
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-c-2.js
@@ -0,0 +1,50 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.4.4.21-8-c-2",
+
+path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-c-2.js",
+
+description: "Array.prototype.reduce throws TypeError when elements assigned values are deleted by reducing array length and initialValue is not present",
+
+test: function testcase() {
+
+ function callbackfn(prevVal, curVal, idx, obj)
+ {
+ }
+
+ var arr = new Array(10);
+ arr[9] = 1;
+ arr.length = 5;
+ try {
+ arr.reduce(callbackfn);
+ }
+ catch(e) {
+ if(e instanceof TypeError)
+ return true;
+ }
+ },
+
+precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-c-3.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-c-3.js
new file mode 100644
index 000000000..2cdeb05ff
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-c-3.js
@@ -0,0 +1,53 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.4.4.21-8-c-3",
+
+path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-c-3.js",
+
+description: "Array.prototype.reduce throws TypeError when elements assigned values are deleted and initialValue is not present",
+
+test: function testcase() {
+
+ function callbackfn(prevVal, curVal, idx, obj)
+ {
+ }
+
+ var arr = [1,2,3,4,5];
+ delete arr[0];
+ delete arr[1];
+ delete arr[2];
+ delete arr[3];
+ delete arr[4];
+ try {
+ arr.reduce(callbackfn);
+ }
+ catch(e) {
+ if(e instanceof TypeError)
+ return true;
+ }
+ },
+
+precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-c-4.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-c-4.js
new file mode 100644
index 000000000..4db1a126d
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-c-4.js
@@ -0,0 +1,50 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-8-c-4",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-c-4.js",
+
+ description: "Array.prototype.reduce doesn't throw error when array has no own properties but prototype contains a single property",
+
+ test: function testcase() {
+
+ var arr = [, , , ];
+
+ try {
+ Array.prototype[1] = "prototype";
+ arr.reduce(function () { });
+ return true;
+ } catch (ex) {
+ return false;
+ } finally {
+ delete Array.prototype[1];
+ }
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce) && ![, 1].hasOwnProperty(0);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-c-5.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-c-5.js
new file mode 100644
index 000000000..2bfa914ba
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-c-5.js
@@ -0,0 +1,56 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-8-c-5",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-c-5.js",
+
+ description: "Array.prototype.reduce - if exception occurs, it occurs after any side-effects that might be produced by step 2",
+
+ test: function testcase() {
+
+ var obj = { };
+
+ var accessed = false;
+
+ Object.defineProperty(obj, "length", {
+ get: function () {
+ accessed = true;
+ return 2;
+ },
+ configurable: true
+ });
+
+ try {
+ Array.prototype.reduce.call(obj, function () { });
+ return false;
+ } catch (ex) {
+ return (ex instanceof TypeError) && accessed;
+ }
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce) && fnExists(Object.defineProperty);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-c-6.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-c-6.js
new file mode 100644
index 000000000..e4cff6c5b
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-c-6.js
@@ -0,0 +1,61 @@
+/// Copyright (c) 2009 Microsoft Corporation
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-8-c-6",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-c-6.js",
+
+ description: "Array.prototype.reduce - if exception occurs, it occurs after any side-effects that might be produced by step 3",
+
+ test: function testcase() {
+
+ var obj = {};
+
+ var accessed = false;
+
+ Object.defineProperty(obj, "length", {
+ get: function () {
+ return {
+ toString: function () {
+ accessed = true;
+ return "2";
+ }
+ };
+ },
+ configurable: true
+ });
+
+ try {
+ Array.prototype.reduce.call(obj, function () { });
+ return false;
+ } catch (ex) {
+ return (ex instanceof TypeError) && accessed;
+ }
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce) && fnExists(Object.defineProperty);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-c-7.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-c-7.js
new file mode 100644
index 000000000..e30ddac30
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-c-7.js
@@ -0,0 +1,53 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-8-c-7",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-c-7.js",
+
+ description: "Array.prototype.reduce - the exception is not thrown if exception was thrown by step 2",
+
+ test: function testcase() {
+
+ var obj = {};
+
+ Object.defineProperty(obj, "length", {
+ get: function () {
+ throw new SyntaxError();
+ },
+ configurable: true
+ });
+
+ try {
+ Array.prototype.reduce.call(obj, function () { });
+ return false;
+ } catch (ex) {
+ return !(ex instanceof TypeError);
+ }
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce) && fnExists(Object.defineProperty);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-c-8.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-c-8.js
new file mode 100644
index 000000000..5e574c02c
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-c-8.js
@@ -0,0 +1,58 @@
+/// Copyright (c) 2009 Microsoft Corporation
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-8-c-8",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-8-c-8.js",
+
+ description: "Array.prototype.reduce - the exception is not thrown if exception was thrown by step 3",
+
+ test: function testcase() {
+
+ var obj = {};
+
+ Object.defineProperty(obj, "length", {
+ get: function () {
+ return {
+ toString: function () {
+ throw new SyntaxError();
+ }
+ };
+ },
+ configurable: true
+ });
+
+ try {
+ Array.prototype.reduce.call(obj, function () { });
+ return false;
+ } catch (ex) {
+ return !(ex instanceof TypeError);
+ }
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce) && fnExists(Object.defineProperty);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-1.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-1.js
new file mode 100644
index 000000000..5235ac075
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-1.js
@@ -0,0 +1,43 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+ id: "15.4.4.21-9-1",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-1.js",
+
+ description: "Array.prototype.reduce doesn't consider new elements added to array after it is called",
+
+ test: function testcase() {
+ function callbackfn(prevVal, curVal, idx, obj) {
+ arr[5] = 6;
+ arr[2] = 3;
+ return prevVal + curVal;
+ }
+
+ var arr = [1, 2, , 4, '5'];
+ return arr.reduce(callbackfn) === "105";
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-10.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-10.js
new file mode 100644
index 000000000..c746d78b3
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-10.js
@@ -0,0 +1,44 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.4.4.21-9-10",
+
+path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-10.js",
+
+description: "Array.prototype.reduce called with an initial value doesn't consider new elements added to array after it is called",
+
+test: function testcase() {
+
+ function callbackfn(prevVal, curVal, idx, obj) {
+ arr[5] = 6;
+ arr[2] = 3;
+ return prevVal + curVal;
+ }
+
+ var arr = [1,2,,4,'5'];
+ return arr.reduce(callbackfn, "") === "12345";
+ },
+
+precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-2.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-2.js
new file mode 100644
index 000000000..0250c8807
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-2.js
@@ -0,0 +1,47 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.4.4.21-9-2",
+
+path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-2.js",
+
+description: "Array.prototype.reduce considers new value of elements in array after it is called",
+
+test: function testcase() {
+
+ function callbackfn(prevVal, curVal, idx, obj)
+ {
+ arr[3] = -2;
+ arr[4] = -1;
+ return prevVal + curVal;
+ }
+
+ var arr = [1,2,3,4,5];
+ if(arr.reduce(callbackfn) === 3)
+ return true;
+
+ },
+
+precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-3.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-3.js
new file mode 100644
index 000000000..15d7f0f7f
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-3.js
@@ -0,0 +1,47 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.4.4.21-9-3",
+
+path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-3.js",
+
+description: "Array.prototype.reduce doesn't visit deleted elements in array after the call",
+
+test: function testcase() {
+
+ function callbackfn(prevVal, curVal, idx, obj)
+ {
+ delete arr[3];
+ delete arr[4];
+ return prevVal + curVal;
+ }
+
+ var arr = ['1',2,3,4,5];
+ if(arr.reduce(callbackfn) === "123" ) // two elements deleted
+ return true;
+
+ },
+
+precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-4.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-4.js
new file mode 100644
index 000000000..5a4a1b194
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-4.js
@@ -0,0 +1,46 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.4.4.21-9-4",
+
+path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-4.js",
+
+description: "Array.prototype.reduce doesn't visit deleted elements when Array.length is decreased",
+
+test: function testcase() {
+
+ function callbackfn(prevVal, curVal, idx, obj)
+ {
+ arr.length = 2;
+ return prevVal + curVal;
+ }
+
+ var arr = [1,2,3,4,5];
+ if(arr.reduce(callbackfn) === 3 )
+ return true;
+
+ },
+
+precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-5.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-5.js
new file mode 100644
index 000000000..01c3c7ebe
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-5.js
@@ -0,0 +1,46 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.4.4.21-9-5",
+
+path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-5.js",
+
+description: "Array.prototype.reduce - callbackfn not called for array with one element",
+
+test: function testcase() {
+
+ var callCnt = 0;
+ function callbackfn(prevVal, curVal, idx, obj)
+ {
+ callCnt++;
+ return 2;
+ }
+
+ var arr = [1];
+ if(arr.reduce(callbackfn) === 1 && callCnt === 0 )
+ return true;
+ },
+
+precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-6.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-6.js
new file mode 100644
index 000000000..eef19d4f5
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-6.js
@@ -0,0 +1,51 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.4.4.21-9-6",
+
+path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-6.js",
+
+description: "Array.prototype.reduce visits deleted element in array after the call when same index is also present in prototype",
+
+test: function testcase() {
+
+ function callbackfn(prevVal, curVal, idx, obj)
+ {
+ delete arr[3];
+ delete arr[4];
+ return prevVal + curVal;
+ }
+
+ Array.prototype[4] = 5;
+ var arr = ['1',2,3,4,5];
+ var res = arr.reduce(callbackfn);
+ delete Array.prototype[4];
+
+ if(res === "1235" ) //one element acually deleted
+ return true;
+
+ },
+
+precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-7.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-7.js
new file mode 100644
index 000000000..164b15c67
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-7.js
@@ -0,0 +1,43 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+ id: "15.4.4.21-9-7",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-7.js",
+
+ description: "Array.prototype.reduce stops calling callbackfn once the array is deleted during the call",
+
+ test: function testcase() {
+ function callbackfn(prevVal, curVal, idx, obj) {
+ delete o.arr;
+ return prevVal + curVal;
+ }
+
+ var o = new Object();
+ o.arr = ['1', 2, 3, 4, 5];
+ return o.arr.reduce(callbackfn) === "12345" && !o.hasOwnProperty("arr");
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-8.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-8.js
new file mode 100644
index 000000000..f453aea3e
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-8.js
@@ -0,0 +1,57 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-9-8",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-8.js",
+
+ description: "Array.prototype.reduce - no observable effects occur if 'len' is 0",
+
+ test: function testcase() {
+
+ var accessed = false;
+ var callbackAccessed = false;
+ function callbackfn() {
+ callbackAccessed = true;
+ }
+
+ var obj = { length: 0 };
+
+ Object.defineProperty(obj, "0", {
+ get: function () {
+ accessed = true;
+ return 10;
+ },
+ configurable: true
+ });
+
+ Array.prototype.reduce.call(obj, function () { }, "initialValue");
+ return !accessed && !callbackAccessed;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce) && fnExists(Object.defineProperty) && fnSupportsArrayIndexGettersOnObjects();
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-9.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-9.js
new file mode 100644
index 000000000..7a3933273
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-9.js
@@ -0,0 +1,56 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-9-9",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-9.js",
+
+ description: "Array.prototype.reduce - modifications to length don't change number of iterations in step 9",
+
+ test: function testcase() {
+ var called = 0;
+ function callbackfn(accum, val, idx, obj) {
+ called++;
+ return accum + val;
+ }
+
+ var arr = [0, 1, 2, 3];
+ Object.defineProperty(arr, "0", {
+ get: function () {
+ arr.length = 2;
+ return 0;
+ },
+ configurable: true
+ });
+
+ var newAccum = arr.reduce(callbackfn, "initialValue");
+
+ return newAccum === "initialValue01" && called === 2;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce) && fnExists(Object.defineProperty) && fnSupportsArrayIndexGettersOnArrays();
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-1.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-1.js
new file mode 100644
index 000000000..33b9d9697
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-1.js
@@ -0,0 +1,45 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.4.4.21-9-b-1",
+
+path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-1.js",
+
+description: "Array.prototype.reduce returns initialvalue when Array is empty and initialValue is present",
+
+test: function testcase() {
+
+ function callbackfn(prevVal, curVal, idx, obj)
+ {
+ }
+
+ var arr = new Array(10);
+
+ if(arr.reduce(callbackfn,5) === 5)
+ return true;
+
+ },
+
+precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-10.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-10.js
new file mode 100644
index 000000000..1faf19429
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-10.js
@@ -0,0 +1,65 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-9-b-10",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-10.js",
+
+ description: "Array.prototype.reduce - deleting property of prototype in step 8 causes deleted index property not to be visited on an Array-like Object",
+
+ test: function testcase() {
+
+ var accessed = false;
+ var testResult = true;
+
+ function callbackfn(accum, val, idx, obj) {
+ accessed = true;
+ if (idx === 3) {
+ testResult = false;
+ }
+ }
+
+ var obj = { 2: 2, length: 20 };
+
+ Object.defineProperty(obj, "0", {
+ get: function () {
+ delete Object.prototype[3];
+ return 0;
+ },
+ configurable: true
+ });
+
+ try {
+ Object.prototype[3] = 1;
+ Array.prototype.reduce.call(obj, callbackfn);
+ return testResult && accessed;
+ } finally {
+ delete Object.prototype[3];
+ }
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce) && fnExists(Object.defineProperty) && fnSupportsArrayIndexGettersOnObjects();
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-11.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-11.js
new file mode 100644
index 000000000..a903ffe24
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-11.js
@@ -0,0 +1,64 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-9-b-11",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-11.js",
+
+ description: "Array.prototype.reduce - deleting property of prototype in step 8 causes deleted index property not to be visited on an Array",
+
+ test: function testcase() {
+
+ var accessed = false;
+ var testResult = true;
+
+ function callbackfn(accum, val, idx, obj) {
+ accessed = true;
+ if (idx === 1) {
+ testResult = false;
+ }
+ }
+
+ var arr = [, , , 3];
+ Object.defineProperty(arr, "0", {
+ get: function () {
+ delete Array.prototype[1];
+ return 0;
+ },
+ configurable: true
+ });
+
+ try {
+ Array.prototype[1] = 1;
+ arr.reduce(callbackfn);
+ return testResult && accessed;
+ } finally {
+ delete Array.prototype[1];
+ }
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce) && fnExists(Object.defineProperty) && ![, 1].hasOwnProperty(0) && fnSupportsArrayIndexGettersOnArrays();
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-12.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-12.js
new file mode 100644
index 000000000..5caa31f9b
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-12.js
@@ -0,0 +1,63 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-9-b-12",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-12.js",
+
+ description: "Array.prototype.reduce - deleting own property with prototype property in step 8 causes prototype index property to be visited on an Array-like object",
+
+ test: function testcase() {
+
+ var testResult = false;
+
+ function callbackfn(accum, val, idx, obj) {
+ if (idx === 1 && val === 1) {
+ testResult = true;
+ }
+ }
+
+ var obj = { 0: 0, 1: 111, 4: 10, length: 10 };
+
+ Object.defineProperty(obj, "0", {
+ get: function () {
+ delete obj[1];
+ return 0;
+ },
+ configurable: true
+ });
+
+ try {
+ Object.prototype[1] = 1;
+ Array.prototype.reduce.call(obj, callbackfn);
+ return testResult;
+ } finally {
+ delete Object.prototype[1];
+ }
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce) && fnExists(Object.defineProperty) && fnSupportsArrayIndexGettersOnObjects();
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-13.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-13.js
new file mode 100644
index 000000000..ace190cc7
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-13.js
@@ -0,0 +1,62 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-9-b-13",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-13.js",
+
+ description: "Array.prototype.reduce - deleting own property with prototype property in step 8 causes prototype index property to be visited on an Array",
+
+ test: function testcase() {
+
+ var testResult = false;
+
+ function callbackfn(accum, val, idx, obj) {
+ if (idx === 1 && val === 1) {
+ testResult = true;
+ }
+ }
+ var arr = [0, 111];
+
+ Object.defineProperty(arr, "0", {
+ get: function () {
+ delete arr[1];
+ return 0;
+ },
+ configurable: true
+ });
+
+ try {
+ Array.prototype[1] = 1;
+ arr.reduce(callbackfn);
+ return testResult;
+ } finally {
+ delete Array.prototype[1];
+ }
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce) && fnExists(Object.defineProperty) && fnSupportsArrayIndexGettersOnArrays();
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-14.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-14.js
new file mode 100644
index 000000000..a80784e7a
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-14.js
@@ -0,0 +1,61 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-9-b-14",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-14.js",
+
+ description: "Array.prototype.reduce - decreasing length of array in step 8 causes deleted index property not to be visited",
+
+ test: function testcase() {
+
+ var accessed = false;
+ var testResult = true;
+
+ function callbackfn(accum, val, idx, obj) {
+ accessed = true;
+ if (idx === 2) {
+ testResult = false;
+ }
+ }
+
+ var arr = [0, 1, 2, 3];
+
+ Object.defineProperty(arr, "0", {
+ get: function () {
+ arr.length = 2;
+ return 0;
+ },
+ configurable: true
+ });
+
+ arr.reduce(callbackfn);
+
+ return testResult && accessed;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce) && fnExists(Object.defineProperty) && fnSupportsArrayIndexGettersOnArrays();
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-15.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-15.js
new file mode 100644
index 000000000..29f29cd3c
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-15.js
@@ -0,0 +1,69 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-9-b-15",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-15.js",
+
+ description: "Array.prototype.reduce - decreasing length of array with prototype property in step 8 causes prototype index property to be visited",
+
+ test: function testcase() {
+
+ var testResult = false;
+
+ function callbackfn(accum, val, idx, obj) {
+ if (idx === 2 && val === "prototype") {
+ testResult = true;
+ }
+ }
+ var arr = [0, 1, 2, 3];
+
+ try {
+ Object.defineProperty(Array.prototype, "2", {
+ get: function () {
+ return "prototype";
+ },
+ configurable: true
+ });
+
+ Object.defineProperty(arr, "0", {
+ get: function () {
+ arr.length = 2;
+ return 1;
+ },
+ configurable: true
+ });
+
+ arr.reduce(callbackfn);
+
+ return testResult;
+ } finally {
+ delete Array.prototype[2];
+ }
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce) && fnExists(Object.defineProperty) && fnSupportsArrayIndexGettersOnArrays();
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-16.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-16.js
new file mode 100644
index 000000000..466911d3c
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-16.js
@@ -0,0 +1,66 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-9-b-16",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-16.js",
+
+ description: "Array.prototype.reduce - decreasing length of array in step 8 does not delete non-configurable properties",
+
+ test: function testcase() {
+
+ var testResult = false;
+
+ function callbackfn(accum, val, idx, obj) {
+ if (idx === 2 && val === "unconfigurable") {
+ testResult = true;
+ }
+ }
+
+ var arr = [0, 1, 2, 3];
+
+ Object.defineProperty(arr, "2", {
+ get: function () {
+ return "unconfigurable";
+ },
+ configurable: false
+ });
+
+ Object.defineProperty(arr, "0", {
+ get: function () {
+ arr.length = 2;
+ return 1;
+ },
+ configurable: true
+ });
+
+ arr.reduce(callbackfn);
+
+ return testResult;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce) && fnExists(Object.defineProperty) && fnSupportsArrayIndexGettersOnArrays();
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-17.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-17.js
new file mode 100644
index 000000000..953c27231
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-17.js
@@ -0,0 +1,63 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-9-b-17",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-17.js",
+
+ description: "Array.prototype.reduce - properties added into own object are visited on an Array-like object",
+
+ test: function testcase() {
+
+ var testResult = false;
+
+ function callbackfn(accum, val, idx, obj) {
+ if (idx === 3 && val === 3) {
+ testResult = true;
+ }
+ }
+
+ var obj = { length: 5 };
+
+ Object.defineProperty(obj, "1", {
+ get: function () {
+ Object.defineProperty(obj, "3", {
+ get: function () {
+ return 3;
+ },
+ configurable: true
+ });
+ return 1;
+ },
+ configurable: true
+ });
+
+ Array.prototype.reduce.call(obj, callbackfn, "initialValue");
+ return testResult;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce) && fnExists(Object.defineProperty) && fnSupportsArrayIndexGettersOnObjects();
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-18.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-18.js
new file mode 100644
index 000000000..83c6f2dcd
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-18.js
@@ -0,0 +1,63 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-9-b-18",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-18.js",
+
+ description: "Array.prototype.reduce - properties added into own object are visited on an Array",
+
+ test: function testcase() {
+
+ var testResult = false;
+
+ function callbackfn(accum, val, idx, obj) {
+ if (idx === 1 && val === 1) {
+ testResult = true;
+ }
+ }
+
+ var arr = [0, , 2];
+
+ Object.defineProperty(arr, "0", {
+ get: function () {
+ Object.defineProperty(arr, "1", {
+ get: function () {
+ return 1;
+ },
+ configurable: true
+ });
+ return 0;
+ },
+ configurable: true
+ });
+
+ arr.reduce(callbackfn, "initialValue");
+ return testResult;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce) && fnExists(Object.defineProperty) && fnSupportsArrayIndexGettersOnArrays();
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-19.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-19.js
new file mode 100644
index 000000000..6ddf1888f
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-19.js
@@ -0,0 +1,67 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-9-b-19",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-19.js",
+
+ description: "Array.prototype.reduce - properties added to prototype are visited on an Array-like object",
+
+ test: function testcase() {
+
+ var testResult = false;
+
+ function callbackfn(accum, val, idx, obj) {
+ if (idx === 1 && val === 6.99) {
+ testResult = true;
+ }
+ }
+
+ var obj = { length: 6 };
+
+ Object.defineProperty(obj, "0", {
+ get: function () {
+ Object.defineProperty(Object.prototype, "1", {
+ get: function () {
+ return 6.99;
+ },
+ configurable: true
+ });
+ return 0;
+ },
+ configurable: true
+ });
+
+ try {
+ Array.prototype.reduce.call(obj, callbackfn, "initialValue");
+ return testResult;
+ } finally {
+ delete Object.prototype[1];
+ }
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce) && fnExists(Object.defineProperty) && fnSupportsArrayIndexGettersOnObjects();
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-2.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-2.js
new file mode 100644
index 000000000..2619e14a3
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-2.js
@@ -0,0 +1,59 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-9-b-2",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-2.js",
+
+ description: "Array.prototype.reduce - added properties in step 2 are visible here",
+
+ test: function testcase() {
+
+ var testResult = false;
+
+ function callbackfn(accum, val, idx, obj) {
+ if (idx === 2 && val === "2") {
+ testResult = true;
+ }
+ }
+
+ var obj = {};
+
+ Object.defineProperty(obj, "length", {
+ get: function () {
+ obj[2] = "2";
+ return 3;
+ },
+ configurable: true
+ });
+
+ Array.prototype.reduce.call(obj, callbackfn, "initialValue");
+
+ return testResult;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce) && fnExists(Object.defineProperty);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-20.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-20.js
new file mode 100644
index 000000000..9d78e05ac
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-20.js
@@ -0,0 +1,67 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-9-b-20",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-20.js",
+
+ description: "Array.prototype.reduce - properties can be added to prototype are visited on an Array",
+
+ test: function testcase() {
+
+ var testResult = false;
+
+ function callbackfn(accum, val, idx, obj) {
+ if (idx === 1 && val === 6.99) {
+ testResult = true;
+ }
+ }
+
+ var arr = [0, , 2];
+
+ Object.defineProperty(arr, "0", {
+ get: function () {
+ Object.defineProperty(Array.prototype, "1", {
+ get: function () {
+ return 6.99;
+ },
+ configurable: true
+ });
+ return 0;
+ },
+ configurable: true
+ });
+
+ try {
+ arr.reduce(callbackfn, "initialValue");
+ return testResult;
+ } finally {
+ delete Array.prototype[1];
+ }
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce) && fnExists(Object.defineProperty) && ![, 1].hasOwnProperty(0) && fnSupportsArrayIndexGettersOnArrays();
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-21.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-21.js
new file mode 100644
index 000000000..3910a6203
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-21.js
@@ -0,0 +1,67 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-9-b-21",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-21.js",
+
+ description: "Array.prototype.reduce - deleting own property causes deleted index property not to be visited on an Array-like object",
+
+ test: function testcase() {
+
+ var accessed = false;
+ var testResult = true;
+
+ function callbackfn(accum, val, idx, obj) {
+ accessed = true;
+ if (idx === 1) {
+ testResult = false;
+ }
+ }
+
+ var obj = { 5: 10, length: 10 };
+
+ Object.defineProperty(obj, "1", {
+ get: function () {
+ return 6.99;
+ },
+ configurable: true
+ });
+
+ Object.defineProperty(obj, "0", {
+ get: function () {
+ delete obj[1];
+ return 0;
+ },
+ configurable: true
+ });
+
+ Array.prototype.reduce.call(obj, callbackfn, "initialValue");
+ return testResult && accessed;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce) && fnExists(Object.defineProperty) && fnSupportsArrayIndexGettersOnObjects();
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-22.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-22.js
new file mode 100644
index 000000000..00f28416f
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-22.js
@@ -0,0 +1,67 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-9-b-22",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-22.js",
+
+ description: "Array.prototype.reduce - deleting own property causes deleted index property not to be visited on an Array",
+
+ test: function testcase() {
+
+ var accessed = false;
+ var testResult = true;
+
+ function callbackfn(accum, val, idx, obj) {
+ accessed = true;
+ if (idx === 1) {
+ testResult = false;
+ }
+ }
+
+ var arr = [1, 2, 4];
+
+ Object.defineProperty(arr, "1", {
+ get: function () {
+ return "6.99";
+ },
+ configurable: true
+ });
+
+ Object.defineProperty(arr, "0", {
+ get: function () {
+ delete arr[1];
+ return 0;
+ },
+ configurable: true
+ });
+
+ arr.reduce(callbackfn, "initialValue");
+ return testResult && accessed;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce) && fnExists(Object.defineProperty) && fnSupportsArrayIndexGettersOnArrays();
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-23.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-23.js
new file mode 100644
index 000000000..d08de8ecb
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-23.js
@@ -0,0 +1,65 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-9-b-23",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-23.js",
+
+ description: "Array.prototype.reduce - deleting property of prototype causes deleted index property not to be visited on an Array-like Object",
+
+ test: function testcase() {
+
+ var accessed = false;
+ var testResult = true;
+
+ function callbackfn(accum, val, idx, obj) {
+ accessed = true;
+ if (idx === 3) {
+ testResult = false;
+ }
+ }
+
+ var obj = { 2: 2, length: 20 };
+
+ Object.defineProperty(obj, "0", {
+ get: function () {
+ delete Object.prototype[3];
+ return 0;
+ },
+ configurable: true
+ });
+
+ try {
+ Object.prototype[3] = 1;
+ Array.prototype.reduce.call(obj, callbackfn, "initialValue");
+ return testResult && accessed;
+ } finally {
+ delete Object.prototype[3];
+ }
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce) && fnExists(Object.defineProperty) && fnSupportsArrayIndexGettersOnObjects();
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-24.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-24.js
new file mode 100644
index 000000000..fd20335bd
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-24.js
@@ -0,0 +1,64 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-9-b-24",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-24.js",
+
+ description: "Array.prototype.reduce - deleting property of prototype causes deleted index property not to be visited on an Array",
+
+ test: function testcase() {
+
+ var accessed = false;
+ var testResult = true;
+
+ function callbackfn(accum, val, idx, obj) {
+ accessed = true;
+ if (idx === 1) {
+ testResult = false;
+ }
+ }
+
+ var arr = [0, , , 3];
+ Object.defineProperty(arr, "0", {
+ get: function () {
+ delete Array.prototype[1];
+ return 0;
+ },
+ configurable: true
+ });
+
+ try {
+ Array.prototype[1] = 1;
+ arr.reduce(callbackfn, "initialValue");
+ return testResult && accessed;
+ } finally {
+ delete Array.prototype[1];
+ }
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce) && fnExists(Object.defineProperty) && ![, 1].hasOwnProperty(0) && fnSupportsArrayIndexGettersOnArrays();
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-25.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-25.js
new file mode 100644
index 000000000..4df7a0098
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-25.js
@@ -0,0 +1,63 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-9-b-25",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-25.js",
+
+ description: "Array.prototype.reduce - deleting own property with prototype property causes prototype index property to be visited on an Array-like object",
+
+ test: function testcase() {
+
+ var testResult = false;
+
+ function callbackfn(accum, val, idx, obj) {
+ if (idx === 1 && val === 1) {
+ testResult = true;
+ }
+ }
+
+ var obj = { 0: 0, 1: 111, 4: 10, length: 10 };
+
+ Object.defineProperty(obj, "0", {
+ get: function () {
+ delete obj[1];
+ return 0;
+ },
+ configurable: true
+ });
+
+ try {
+ Object.prototype[1] = 1;
+ Array.prototype.reduce.call(obj, callbackfn, "initialValue");
+ return testResult;
+ } finally {
+ delete Object.prototype[1];
+ }
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce) && fnExists(Object.defineProperty) && fnSupportsArrayIndexGettersOnObjects();
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-26.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-26.js
new file mode 100644
index 000000000..526b81428
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-26.js
@@ -0,0 +1,62 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-9-b-26",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-26.js",
+
+ description: "Array.prototype.reduce - deleting own property with prototype property causes prototype index property to be visited on an Array",
+
+ test: function testcase() {
+
+ var testResult = false;
+
+ function callbackfn(accum, val, idx, obj) {
+ if (idx === 1 && val === 1) {
+ testResult = true;
+ }
+ }
+ var arr = [0, 111];
+
+ Object.defineProperty(arr, "0", {
+ get: function () {
+ delete arr[1];
+ return 0;
+ },
+ configurable: true
+ });
+
+ try {
+ Array.prototype[1] = 1;
+ arr.reduce(callbackfn, "initialValue");
+ return testResult;
+ } finally {
+ delete Array.prototype[1];
+ }
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce) && fnExists(Object.defineProperty) && fnSupportsArrayIndexGettersOnArrays();
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-27.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-27.js
new file mode 100644
index 000000000..a8f94fc91
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-27.js
@@ -0,0 +1,61 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-9-b-27",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-27.js",
+
+ description: "Array.prototype.reduce - decreasing length of array causes deleted index property not to be visited",
+
+ test: function testcase() {
+
+ var accessed = false;
+ var testResult = true;
+
+ function callbackfn(accum, val, idx, obj) {
+ accessed = true;
+ if (idx === 2) {
+ testResult = false;
+ }
+ }
+
+ var arr = [0, 1, 2, 3];
+
+ Object.defineProperty(arr, "0", {
+ get: function () {
+ arr.length = 2;
+ return 0;
+ },
+ configurable: true
+ });
+
+ arr.reduce(callbackfn, "initialValue");
+
+ return testResult && accessed;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce) && fnExists(Object.defineProperty) && fnSupportsArrayIndexGettersOnArrays();
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-28.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-28.js
new file mode 100644
index 000000000..8581a67ab
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-28.js
@@ -0,0 +1,69 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-9-b-28",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-28.js",
+
+ description: "Array.prototype.reduce - decreasing length of array with prototype property causes prototype index property to be visited",
+
+ test: function testcase() {
+
+ var testResult = false;
+
+ function callbackfn(accum, val, idx, obj) {
+ if (idx === 2 && val === "prototype") {
+ testResult = true;
+ }
+ }
+ var arr = [0, 1, 2, 3];
+
+ try {
+ Object.defineProperty(Array.prototype, "2", {
+ get: function () {
+ return "prototype";
+ },
+ configurable: true
+ });
+
+ Object.defineProperty(arr, "0", {
+ get: function () {
+ arr.length = 2;
+ return 1;
+ },
+ configurable: true
+ });
+
+ arr.reduce(callbackfn, "initialValue");
+
+ return testResult;
+ } finally {
+ delete Array.prototype[2];
+ }
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce) && fnExists(Object.defineProperty) && fnSupportsArrayIndexGettersOnArrays();
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-29.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-29.js
new file mode 100644
index 000000000..0cb63ef96
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-29.js
@@ -0,0 +1,66 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-9-b-29",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-29.js",
+
+ description: "Array.prototype.reduce - decreasing length of array does not delete non-configurable properties",
+
+ test: function testcase() {
+
+ var testResult = false;
+
+ function callbackfn(accum, val, idx, obj) {
+ if (idx === 2 && val === "unconfigurable") {
+ testResult = true;
+ }
+ }
+
+ var arr = [0, 1, 2, 3];
+
+ Object.defineProperty(arr, "2", {
+ get: function () {
+ return "unconfigurable";
+ },
+ configurable: false
+ });
+
+ Object.defineProperty(arr, "0", {
+ get: function () {
+ arr.length = 2;
+ return 1;
+ },
+ configurable: true
+ });
+
+ arr.reduce(callbackfn, "initialValue");
+
+ return testResult;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce) && fnExists(Object.defineProperty) && fnSupportsArrayIndexGettersOnArrays();
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-3.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-3.js
new file mode 100644
index 000000000..39238b8c2
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-3.js
@@ -0,0 +1,61 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-9-b-3",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-3.js",
+
+ description: "Array.prototype.reduce - deleted properties in step 2 are visible here",
+
+ test: function testcase() {
+
+ var accessed = false;
+ var testResult = true;
+
+ function callbackfn(accum, val, idx, obj) {
+ accessed = true;
+ if (idx === 2) {
+ testResult = false;
+ }
+ }
+
+ var obj = { 2: "2", 3: 10 };
+
+ Object.defineProperty(obj, "length", {
+ get: function () {
+ delete obj[2];
+ return 5;
+ },
+ configurable: true
+ });
+
+ Array.prototype.reduce.call(obj, callbackfn, "initialValue");
+
+ return accessed && testResult;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce) && fnExists(Object.defineProperty);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-4.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-4.js
new file mode 100644
index 000000000..62f51e174
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-4.js
@@ -0,0 +1,63 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-9-b-4",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-4.js",
+
+ description: "Array.prototype.reduce - properties added into own object in step 8 are visited on an Array-like object",
+
+ test: function testcase() {
+
+ var testResult = false;
+
+ function callbackfn(accum, val, idx, obj) {
+ if (idx === 3 && val === 3) {
+ testResult = true;
+ }
+ }
+
+ var obj = { length: 5 };
+
+ Object.defineProperty(obj, "1", {
+ get: function () {
+ Object.defineProperty(obj, "3", {
+ get: function () {
+ return 3;
+ },
+ configurable: true
+ });
+ return 1;
+ },
+ configurable: true
+ });
+
+ Array.prototype.reduce.call(obj, callbackfn);
+ return testResult;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce) && fnExists(Object.defineProperty) && fnSupportsArrayIndexGettersOnObjects();
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-5.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-5.js
new file mode 100644
index 000000000..471be11d6
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-5.js
@@ -0,0 +1,63 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-9-b-5",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-5.js",
+
+ description: "Array.prototype.reduce - properties added into own object in step 8 are visited on an Array",
+
+ test: function testcase() {
+
+ var testResult = false;
+
+ function callbackfn(accum, val, idx, obj) {
+ if (idx === 1 && val === 1) {
+ testResult = true;
+ }
+ }
+
+ var arr = [0, , 2];
+
+ Object.defineProperty(arr, "0", {
+ get: function () {
+ Object.defineProperty(arr, "1", {
+ get: function () {
+ return 1;
+ },
+ configurable: true
+ });
+ return 0;
+ },
+ configurable: true
+ });
+
+ arr.reduce(callbackfn);
+ return testResult;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce) && fnExists(Object.defineProperty) && fnSupportsArrayIndexGettersOnArrays();
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-6.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-6.js
new file mode 100644
index 000000000..d7309d907
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-6.js
@@ -0,0 +1,67 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-9-b-6",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-6.js",
+
+ description: "Array.prototype.reduce - properties added to prototype in step 8 are visited on an Array-like object",
+
+ test: function testcase() {
+
+ var testResult = false;
+
+ function callbackfn(accum, val, idx, obj) {
+ if (idx === 1 && val === 6.99) {
+ testResult = true;
+ }
+ }
+
+ var obj = { length: 6 };
+
+ Object.defineProperty(obj, "0", {
+ get: function () {
+ Object.defineProperty(Object.prototype, "1", {
+ get: function () {
+ return 6.99;
+ },
+ configurable: true
+ });
+ return 0;
+ },
+ configurable: true
+ });
+
+ try {
+ Array.prototype.reduce.call(obj, callbackfn);
+ return testResult;
+ } finally {
+ delete Object.prototype[1];
+ }
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce) && fnExists(Object.defineProperty) && fnSupportsArrayIndexGettersOnObjects();
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-7.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-7.js
new file mode 100644
index 000000000..2840007ff
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-7.js
@@ -0,0 +1,67 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-9-b-7",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-7.js",
+
+ description: "Array.prototype.reduce - properties added to prototype in step 8 are visited on an Array",
+
+ test: function testcase() {
+
+ var testResult = false;
+
+ function callbackfn(accum, val, idx, obj) {
+ if (idx === 1 && val === 6.99) {
+ testResult = true;
+ }
+ }
+
+ var arr = [0, , 2];
+
+ Object.defineProperty(arr, "0", {
+ get: function () {
+ Object.defineProperty(Array.prototype, "1", {
+ get: function () {
+ return 6.99;
+ },
+ configurable: true
+ });
+ return 0;
+ },
+ configurable: true
+ });
+
+ try {
+ arr.reduce(callbackfn);
+ return testResult;
+ } finally {
+ delete Array.prototype[1];
+ }
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce) && fnExists(Object.defineProperty) && ![, 1].hasOwnProperty(0) && fnSupportsArrayIndexGettersOnArrays();
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-8.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-8.js
new file mode 100644
index 000000000..ce7b51023
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-8.js
@@ -0,0 +1,67 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-9-b-8",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-8.js",
+
+ description: "Array.prototype.reduce - deleting own property in step 8 causes deleted index property not to be visited on an Array-like object",
+
+ test: function testcase() {
+
+ var accessed = false;
+ var testResult = true;
+
+ function callbackfn(accum, val, idx, obj) {
+ accessed = true;
+ if (idx === 1) {
+ testResult = false;
+ }
+ }
+
+ var obj = { 5: 10, length: 10 };
+
+ Object.defineProperty(obj, "1", {
+ get: function () {
+ return 6.99;
+ },
+ configurable: true
+ });
+
+ Object.defineProperty(obj, "0", {
+ get: function () {
+ delete obj[1];
+ return 0;
+ },
+ configurable: true
+ });
+
+ Array.prototype.reduce.call(obj, callbackfn);
+ return testResult && accessed;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce) && fnExists(Object.defineProperty) && fnSupportsArrayIndexGettersOnObjects();
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-9.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-9.js
new file mode 100644
index 000000000..5fd43deab
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-9.js
@@ -0,0 +1,60 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-9-b-9",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-b-9.js",
+
+ description: "Array.prototype.reduce - deleting own property in step 8 causes deleted index property not to be visited on an Array",
+
+ test: function testcase() {
+
+ var accessed = false;
+ var testResult = true;
+
+ function callbackfn(accum, val, idx, obj) {
+ accessed = true;
+ if (idx === 1) {
+ testResult = false;
+ }
+ }
+
+ var arr = [1, 2, 4];
+
+ Object.defineProperty(arr, "0", {
+ get: function () {
+ delete arr[1];
+ return 0;
+ },
+ configurable: true
+ });
+
+ arr.reduce(callbackfn);
+ return testResult && accessed;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce) && fnExists(Object.defineProperty) && fnSupportsArrayIndexGettersOnArrays();
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-1.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-1.js
new file mode 100644
index 000000000..53a653f68
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-1.js
@@ -0,0 +1,47 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.4.4.21-9-c-1",
+
+path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-1.js",
+
+description: "Array.prototype.reduce - callbackfn not called for indexes never been assigned values",
+
+test: function testcase() {
+
+ var callCnt = 0;
+ function callbackfn(prevVal, curVal, idx, obj)
+ {
+ callCnt++;
+ return curVal;
+ }
+
+ var arr = new Array(10);
+ arr[0] = arr[1] = undefined; //explicitly assigning a value
+ if( arr.reduce(callbackfn) === undefined && callCnt === 1)
+ return true;
+ },
+
+precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-1.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-1.js
new file mode 100644
index 000000000..05ef0baa5
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-1.js
@@ -0,0 +1,48 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-9-c-i-1",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-1.js",
+
+ description: "Array.prototype.reduce - element to be retrieved is own data property on an Array-like object",
+
+ test: function testcase() {
+
+ var testResult = false;
+ var initialValue = 0;
+ function callbackfn(prevVal, curVal, idx, obj) {
+ if (idx === 1) {
+ testResult = (curVal === 1);
+ }
+ }
+
+ var obj = { 0: 0, 1: 1, 2: 2, length: 2 };
+ Array.prototype.reduce.call(obj, callbackfn, initialValue);
+ return testResult;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-10.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-10.js
new file mode 100644
index 000000000..3b7bdc7e4
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-10.js
@@ -0,0 +1,58 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-9-c-i-10",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-10.js",
+
+ description: "Array.prototype.reduce - element to be retrieved is own accessor property on an Array",
+
+ test: function testcase() {
+
+ var testResult = false;
+ var initialValue = 0;
+ function callbackfn(prevVal, curVal, idx, obj) {
+ if (idx === 1) {
+ testResult = (curVal === 1);
+ }
+ }
+
+ var arr = [0, , 2];
+
+ Object.defineProperty(arr, "1", {
+ get: function () {
+ return 1;
+ },
+ configurable: true
+ });
+
+ arr.reduce(callbackfn, initialValue);
+ return testResult;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce) && fnExists(Object.defineProperty) && fnSupportsArrayIndexGettersOnArrays();
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-11.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-11.js
new file mode 100644
index 000000000..aaf4ba46f
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-11.js
@@ -0,0 +1,64 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-9-c-i-11",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-11.js",
+
+ description: "Array.prototype.reduce - element to be retrieved is own accessor property that overrides an inherited data property on an Array-like object",
+
+ test: function testcase() {
+
+ var testResult = false;
+ var initialValue = 0;
+ function callbackfn(prevVal, curVal, idx, obj) {
+ if (idx === 1) {
+ testResult = (curVal === "11");
+ }
+ }
+
+ var proto = { 0: 0, 1: 1, 2: 2 };
+
+ var Con = function () { };
+ Con.prototype = proto;
+
+ var child = new Con();
+ child.length = 3;
+
+ Object.defineProperty(child, "1", {
+ get: function () {
+ return "11";
+ },
+ configurable: true
+ });
+
+ Array.prototype.reduce.call(child, callbackfn, initialValue);
+ return testResult;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce) && fnExists(Object.defineProperty) && fnSupportsArrayIndexGettersOnObjects();
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-12.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-12.js
new file mode 100644
index 000000000..b6a21ebb3
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-12.js
@@ -0,0 +1,64 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-9-c-i-12",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-12.js",
+
+ description: "Array.prototype.reduce - element to be retrieved is own accessor property that overrides an inherited data property on an Array",
+
+ test: function testcase() {
+
+ var testResult = false;
+ var initialValue = 0;
+ function callbackfn(prevVal, curVal, idx, obj) {
+ if (idx === 1) {
+ testResult = (curVal === "11");
+ }
+ }
+
+ try {
+ Array.prototype[1] = 1;
+ var arr = [0, ,2];
+
+ Object.defineProperty(arr, "1", {
+ get: function () {
+ return "11";
+ },
+ configurable: true
+ });
+
+ arr.reduce(callbackfn, initialValue);
+ return testResult;
+
+ } finally {
+ delete Array.prototype[1];
+ }
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce) && fnExists(Object.defineProperty) && fnSupportsArrayIndexGettersOnArrays();
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-13.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-13.js
new file mode 100644
index 000000000..4191b4529
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-13.js
@@ -0,0 +1,70 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-9-c-i-13",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-13.js",
+
+ description: "Array.prototype.reduce - element to be retrieved is own accessor property that overrides an inherited accessor property on an Array-like object",
+ test: function testcase() {
+
+ var testResult = false;
+ var initialValue = 0;
+ function callbackfn(prevVal, curVal, idx, obj) {
+ if (idx === 1) {
+ testResult = (curVal === "11");
+ }
+ }
+
+ var proto = { 0: 0, 2: 2};
+
+ Object.defineProperty(proto, "1", {
+ get: function () {
+ return 1;
+ },
+ configurable: true
+ });
+
+ var Con = function () { };
+ Con.prototype = proto;
+
+ var child = new Con();
+ child.length = 3;
+
+ Object.defineProperty(child, "1", {
+ get: function () {
+ return "11";
+ },
+ configurable: true
+ });
+
+ Array.prototype.reduce.call(child, callbackfn, initialValue);
+ return testResult;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce) && fnExists(Object.defineProperty) && fnSupportsArrayIndexGettersOnObjects();
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-14.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-14.js
new file mode 100644
index 000000000..7870ce7ff
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-14.js
@@ -0,0 +1,69 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-9-c-i-14",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-14.js",
+
+ description: "Array.prototype.reduce - element to be retrieved is own accessor property that overrides an inherited accessor property on an Array",
+
+ test: function testcase() {
+
+ var testResult = false;
+ var initialValue = 0;
+ function callbackfn(prevVal, curVal, idx, obj) {
+ if (idx === 1) {
+ testResult = (curVal === "11");
+ }
+ }
+
+ try {
+ Object.defineProperty(Array.prototype, "1", {
+ get: function () {
+ return 1;
+ },
+ configurable: true
+ });
+
+ var arr = [0, ,2];
+
+ Object.defineProperty(arr, "1", {
+ get: function () {
+ return "11";
+ },
+ configurable: true
+ });
+ arr.reduce(callbackfn, initialValue);
+ return testResult;
+
+ } finally {
+ delete Array.prototype[1];
+ }
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce) && fnExists(Object.defineProperty) && fnSupportsArrayIndexGettersOnArrays();
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-15.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-15.js
new file mode 100644
index 000000000..80664cadb
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-15.js
@@ -0,0 +1,64 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-9-c-i-15",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-15.js",
+
+ description: "Array.prototype.reduce - element to be retrieved is inherited accessor property on an Array-like object",
+
+ test: function testcase() {
+
+ var testResult = false;
+ var initialValue = 0;
+ function callbackfn(prevVal, curVal, idx, obj) {
+ if (idx === 1) {
+ testResult = (curVal === 1);
+ }
+ }
+
+ var proto = { 0: 0, 2: 2 };
+
+ Object.defineProperty(proto, "1", {
+ get: function () {
+ return 1;
+ },
+ configurable: true
+ });
+
+ var Con = function () { };
+ Con.prototype = proto;
+
+ var child = new Con();
+ child.length = 3;
+
+ Array.prototype.reduce.call(child, callbackfn, initialValue);
+ return testResult;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce) && fnExists(Object.defineProperty) && fnSupportsArrayIndexGettersOnObjects();
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-16.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-16.js
new file mode 100644
index 000000000..5bbc051d1
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-16.js
@@ -0,0 +1,62 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-9-c-i-16",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-16.js",
+
+ description: "Array.prototype.reduce - element to be retrieved is inherited accessor property on an Array",
+
+ test: function testcase() {
+
+ var testResult = false;
+ var initialValue = 0;
+ function callbackfn(prevVal, curVal, idx, obj) {
+ if (idx === 1) {
+ testResult = (curVal === 1);
+ }
+ }
+
+ try {
+ Object.defineProperty(Array.prototype, "1", {
+ get: function () {
+ return 1;
+ },
+ configurable: true
+ });
+
+ var arr = [0, , 2, ];
+
+ arr.reduce(callbackfn, initialValue);
+ return testResult;
+
+ } finally {
+ delete Array.prototype[1];
+ }
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce) && fnExists(Object.defineProperty) && ![, 1].hasOwnProperty(0) && fnSupportsArrayIndexGettersOnArrays();
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-17.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-17.js
new file mode 100644
index 000000000..21ba467bb
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-17.js
@@ -0,0 +1,56 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-9-c-i-17",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-17.js",
+
+ description: "Array.prototype.reduce - element to be retrieved is own accessor property without a get function on an Array-like object",
+
+ test: function testcase() {
+
+ var testResult = false;
+ var initialValue = 0;
+ function callbackfn(prevVal, curVal, idx, obj) {
+ if (idx === 1) {
+ testResult = (curVal === undefined);
+ }
+ }
+
+ var obj = { 0: 0, 2: 2, length: 3 };
+
+ Object.defineProperty(obj, "1", {
+ set: function () { },
+ configurable: true
+ });
+
+ Array.prototype.reduce.call(obj, callbackfn, initialValue);
+ return testResult;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce) && fnExists(Object.defineProperty) && fnSupportsArrayIndexGettersOnObjects();
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-18.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-18.js
new file mode 100644
index 000000000..04857f928
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-18.js
@@ -0,0 +1,57 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-9-c-i-18",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-18.js",
+
+ description: "Array.prototype.reduce - element to be retrieved is own accessor property without a get function on an Array",
+
+ test: function testcase() {
+
+ var testResult = false;
+ var initialValue = 0;
+ function callbackfn(prevVal, curVal, idx, obj) {
+ if (idx === 1) {
+ testResult = (curVal === undefined);
+ }
+ }
+
+ var arr = [0, , 2];
+
+ Object.defineProperty(arr, "1", {
+ set: function () { },
+ configurable: true
+ });
+
+ arr.reduce(callbackfn, initialValue);
+ return testResult;
+
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce) && fnExists(Object.defineProperty) && fnSupportsArrayIndexGettersOnArrays();
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-19.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-19.js
new file mode 100644
index 000000000..10ad7009e
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-19.js
@@ -0,0 +1,67 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-9-c-i-19",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-19.js",
+
+ description: "Array.prototype.reduce - element to be retrieved is own accessor property without a get function that overrides an inherited accessor property on an Array-like object",
+
+ test: function testcase() {
+
+ var testResult = false;
+ var initialValue = 0;
+ function callbackfn(prevVal, curVal, idx, obj) {
+ if (idx === 1) {
+ testResult = (curVal === undefined);
+ }
+ }
+
+ try {
+ Object.defineProperty(Object.prototype, "1", {
+ get: function () {
+ return 1;
+ },
+ configurable: true
+ });
+
+ var obj = { 0: 0, 2: 2, length: 3 };
+
+ Object.defineProperty(obj, "1", {
+ set: function () { },
+ configurable: true
+ });
+
+ Array.prototype.reduce.call(obj, callbackfn, initialValue);
+ return testResult;
+ } finally {
+ delete Object.prototype[1];
+ }
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce) && fnExists(Object.defineProperty) && fnSupportsArrayIndexGettersOnObjects();
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-2.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-2.js
new file mode 100644
index 000000000..b694ee120
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-2.js
@@ -0,0 +1,49 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-9-c-i-2",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-2.js",
+
+ description: "Array.prototype.reduce - element to be retrieved is own data property on an Array",
+
+ test: function testcase() {
+
+ var testResult = false;
+ var initialValue = 0;
+ function callbackfn(prevVal, curVal, idx, obj) {
+ if (idx === 1) {
+ testResult = (curVal === 1);
+ }
+ }
+
+ var arr = [0, 1];
+ arr.reduce(callbackfn, initialValue);
+ return testResult;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-20.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-20.js
new file mode 100644
index 000000000..34b284d52
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-20.js
@@ -0,0 +1,67 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-9-c-i-20",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-20.js",
+
+ description: "Array.prototype.reduce - element to be retrieved is own accessor property without a get function that overrides an inherited accessor property on an Array",
+
+ test: function testcase() {
+
+ var testResult = false;
+ var initialValue = 0;
+ function callbackfn(prevVal, curVal, idx, obj) {
+ if (idx === 1) {
+ testResult = (curVal === undefined);
+ }
+ }
+
+ try {
+ Object.defineProperty(Array.prototype, "1", {
+ get: function () {
+ return 11;
+ },
+ configurable: true
+ });
+
+ var arr = [0, , 2];
+ Object.defineProperty(arr, "1", {
+ set: function () { },
+ configurable: true
+ });
+
+ arr.reduce(callbackfn, initialValue);
+ return testResult;
+
+ } finally {
+ delete Array.prototype[1];
+ }
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce) && fnExists(Object.defineProperty) && fnSupportsArrayIndexGettersOnArrays();
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-21.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-21.js
new file mode 100644
index 000000000..febf7e349
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-21.js
@@ -0,0 +1,61 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-9-c-i-21",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-21.js",
+
+ description: "Array.prototype.reduce - element to be retrieved is inherited accessor property without a get function on an Array-like object",
+
+ test: function testcase() {
+
+ var testResult = false;
+ var initialValue = 0;
+ function callbackfn(prevVal, curVal, idx, obj) {
+ if (idx === 1) {
+ testResult = (curVal === undefined);
+ }
+ }
+
+ var proto = { 0: 0, 2: 2 };
+
+ Object.defineProperty(proto, "1", {
+ set: function () { },
+ configurable: true
+ });
+
+ var Con = function () { };
+ Con.prototype = proto;
+
+ var child = new Con();
+ child.length = 3;
+
+ Array.prototype.reduce.call(child, callbackfn, initialValue);
+ return testResult;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce) && fnExists(Object.defineProperty) && fnSupportsArrayIndexGettersOnObjects();
+ }
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-22.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-22.js
new file mode 100644
index 000000000..be3360b77
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-22.js
@@ -0,0 +1,61 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-9-c-i-22",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-22.js",
+
+ description: "Array.prototype.reduce - element to be retrieved is inherited accessor property without a get function on an Array",
+
+ test: function testcase() {
+
+ var testResult = false;
+ var initialValue = 0;
+ function callbackfn(prevVal, curVal, idx, obj) {
+ if (idx === 1) {
+ testResult = (curVal === undefined);
+ }
+ }
+
+ try {
+ Object.defineProperty(Array.prototype, "1", {
+ set: function () { },
+ configurable: true
+ });
+
+ var arr = [0, , 2];
+
+ arr.reduce(callbackfn, initialValue);
+ return testResult;
+
+ } finally {
+ delete Array.prototype[1];
+ }
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce) && fnExists(Object.defineProperty) && ![, 1].hasOwnProperty(0) && fnSupportsArrayIndexGettersOnArrays();
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-23.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-23.js
new file mode 100644
index 000000000..a8473bd9a
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-23.js
@@ -0,0 +1,60 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-9-c-i-23",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-23.js",
+
+ description: "Array.prototype.reduce - This object is the global object which contains index property",
+
+ test: function testcase() {
+
+ var testResult = false;
+ var initialValue = 0;
+ function callbackfn(prevVal, curVal, idx, obj) {
+ if (idx === 1) {
+ testResult = (curVal === 1);
+ }
+ }
+
+ try {
+ var oldLen = fnGlobalObject().length;
+ fnGlobalObject()[0] = 0;
+ fnGlobalObject()[1] = 1;
+ fnGlobalObject().length = 2;
+
+ Array.prototype.reduce.call(fnGlobalObject(), callbackfn, initialValue);
+ return testResult;
+
+ } finally {
+ delete fnGlobalObject()[0];
+ delete fnGlobalObject()[1];
+ fnGlobalObject().length = oldLen;
+ }
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-25.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-25.js
new file mode 100644
index 000000000..ed6571091
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-25.js
@@ -0,0 +1,53 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-9-c-i-25",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-25.js",
+
+ description: "Array.prototype.reduce - This object is the Arguments object which implements its own property get method (number of arguments is less than number of parameters)",
+
+ test: function testcase() {
+
+ var testResult = false;
+ var initialValue = 0;
+ function callbackfn(prevVal, curVal, idx, obj) {
+ if (idx === 1) {
+ testResult = (curVal === 1);
+ }
+ }
+
+ var func = function (a, b, c) {
+ Array.prototype.reduce.call(arguments, callbackfn, initialValue);
+ };
+
+ func(0, 1);
+ return testResult;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-26.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-26.js
new file mode 100644
index 000000000..574a8112e
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-26.js
@@ -0,0 +1,53 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-9-c-i-26",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-26.js",
+
+ description: "Array.prototype.reduce - This object is the Arguments object which implements its own property get method (number of arguments equals number of parameters)",
+
+ test: function testcase() {
+
+ var testResult = false;
+ var initialValue = 0;
+ function callbackfn(prevVal, curVal, idx, obj) {
+ if (idx === 2) {
+ testResult = (curVal === 2);
+ }
+ }
+
+ var func = function (a, b, c) {
+ Array.prototype.reduce.call(arguments, callbackfn, initialValue);
+ };
+
+ func(0, 1, 2);
+ return testResult;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-27.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-27.js
new file mode 100644
index 000000000..189dac36d
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-27.js
@@ -0,0 +1,53 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-9-c-i-27",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-27.js",
+
+ description: "Array.prototype.reduce - This object is the Arguments object which implements its own property get method (number of arguments is greater than number of parameters)",
+
+ test: function testcase() {
+
+ var testResult = false;
+ var initialValue = 0;
+ function callbackfn(prevVal, curVal, idx, obj) {
+ if (idx === 3) {
+ testResult = (curVal === 3);
+ }
+ }
+
+ var func = function (a, b, c) {
+ Array.prototype.reduce.call(arguments, callbackfn, initialValue);
+ };
+
+ func(0, 1, 2, 3);
+ return testResult;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-28.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-28.js
new file mode 100644
index 000000000..724a78286
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-28.js
@@ -0,0 +1,52 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-9-c-i-28",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-28.js",
+
+ description: "Array.prototype.reduce - applied to String object, which implements its own property get method",
+
+ test: function testcase() {
+
+ var testResult = false;
+ var initialValue = 0;
+ function callbackfn(prevVal, curVal, idx, obj) {
+ if (idx === 1) {
+ testResult = (curVal === "1");
+ }
+ }
+
+ var str = new String("012");
+
+ Array.prototype.reduce.call(str, callbackfn, initialValue);
+ return testResult;
+
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+
+}); \ No newline at end of file
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-29.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-29.js
new file mode 100644
index 000000000..c18e3349a
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-29.js
@@ -0,0 +1,57 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-9-c-i-29",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-29.js",
+
+ description: "Array.prototype.reduce - applied to Function object which implements its own property get method",
+
+ test: function testcase() {
+
+ var testResult = false;
+ var initialValue = 0;
+ function callbackfn(prevVal, curVal, idx, obj) {
+ if (idx === 1) {
+ testResult = (curVal === 1);
+ }
+ }
+
+ var obj = function (a, b, c) {
+ return a + b + c;
+ };
+ obj[0] = 0;
+ obj[1] = 1;
+ obj[2] = 2;
+ obj[3] = 3;
+
+ Array.prototype.reduce.call(obj, callbackfn, initialValue);
+ return testResult;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+
+}); \ No newline at end of file
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-3.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-3.js
new file mode 100644
index 000000000..9e5ed7ea4
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-3.js
@@ -0,0 +1,58 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-9-c-i-3",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-3.js",
+
+ description: "Array.prototype.reduce - element to be retrieved is own data property that overrides an inherited data property on an Array-like object",
+
+ test: function testcase() {
+
+ var testResult = false;
+ var initialValue = 0;
+ function callbackfn(prevVal, curVal, idx, obj) {
+ if (idx === 1) {
+ testResult = (curVal === "11");
+ }
+ }
+
+ var proto = { 0: 0, 1: 1, 2: 2, length: 2 };
+ var Con = function () { };
+ Con.prototype = proto;
+
+ var child = new Con();
+ child[1] = "11";
+ child[2] = "22";
+ child.length = 3;
+
+ Array.prototype.reduce.call(child, callbackfn, initialValue);
+ return testResult;
+
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-30.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-30.js
new file mode 100644
index 000000000..407a3dea6
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-30.js
@@ -0,0 +1,71 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-9-c-i-30",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-30.js",
+
+ description: "Array.prototype.reduce - element changed by getter on previous iterations is observed on an Array",
+
+ test: function testcase() {
+
+ var testResult = false;
+ var initialValue = 0;
+ function callbackfn(prevVal, curVal, idx, obj) {
+ if (idx === 1) {
+ testResult = (curVal === 1);
+ }
+ }
+
+ var arr = [, , 2];
+ var preIterVisible = false;
+
+ Object.defineProperty(arr, "0", {
+ get: function () {
+ preIterVisible = true;
+ return 0;
+ },
+ configurable: true
+ });
+
+ Object.defineProperty(arr, "1", {
+ get: function () {
+ if (preIterVisible) {
+ return 1;
+ } else {
+ return 100;
+ }
+ },
+ configurable: true
+ });
+
+ arr.reduce(callbackfn, initialValue);
+ return testResult;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce) && fnExists(Object.defineProperty) && fnSupportsArrayIndexGettersOnArrays();
+ }
+
+}); \ No newline at end of file
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-31.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-31.js
new file mode 100644
index 000000000..b5a964d75
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-31.js
@@ -0,0 +1,72 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-9-c-i-31",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-31.js",
+
+ description: "Array.prototype.reduce - element changed by getter on previous iterations is observed on an Array-like object",
+
+ test: function testcase() {
+
+ var testResult = false;
+ var initialValue = 0;
+ function callbackfn(prevVal, curVal, idx, obj) {
+ if (idx === 1) {
+ testResult = (curVal === 1);
+ }
+ }
+
+ var obj = { 2: 2, length: 3 };
+ var preIterVisible = false;
+
+ Object.defineProperty(obj, "0", {
+ get: function () {
+ preIterVisible = true;
+ return 0;
+ },
+ configurable: true
+ });
+
+ Object.defineProperty(obj, "1", {
+ get: function () {
+ if (preIterVisible) {
+ return 1;
+ } else {
+ return "11";
+ }
+ },
+ configurable: true
+ });
+
+ Array.prototype.reduce.call(obj, callbackfn, initialValue);
+ return testResult;
+
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce) && fnExists(Object.defineProperty) && fnSupportsArrayIndexGettersOnObjects();
+ }
+
+}); \ No newline at end of file
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-32.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-32.js
new file mode 100644
index 000000000..09ec8cf9f
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-32.js
@@ -0,0 +1,63 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-9-c-i-32",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-32.js",
+
+ description: "Array.prototype.reduce - unnhandled exceptions happened in getter terminate iteration on an Array-like object",
+
+ test: function testcase() {
+
+ var accessed = false;
+ var testResult = false;
+ var initialValue = 0;
+ function callbackfn(prevVal, curVal, idx, obj) {
+ if (idx >= 1) {
+ accessed = true;
+ testResult = (curVal >= 1);
+ }
+ }
+
+ var obj = { 0: 0, 2: 2, length: 3 };
+ Object.defineProperty(obj, "1", {
+ get: function () {
+ throw new RangeError("unhandle exception happened in getter");
+ },
+ configurable: true
+ });
+
+ try {
+ Array.prototype.reduce.call(obj, callbackfn, initialValue);
+ return false;
+ } catch (ex) {
+ return (ex instanceof RangeError) && !accessed && !testResult;
+ }
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce) && fnExists(Object.defineProperty) && fnSupportsArrayIndexGettersOnObjects();
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-33.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-33.js
new file mode 100644
index 000000000..7ba076b7a
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-33.js
@@ -0,0 +1,64 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-9-c-i-33",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-33.js",
+
+ description: "Array.prototype.reduce - unnhandled exceptions happened in getter terminate iteration on an Array",
+
+ test: function testcase() {
+
+ var accessed = false;
+ var testResult = false;
+ var initialValue = 0;
+ function callbackfn(prevVal, curVal, idx, obj) {
+ if (idx >= 1) {
+ accessed = true;
+ testResult = (curVal >= 1);
+ }
+ }
+
+ var arr = [0, , 2];
+
+ Object.defineProperty(arr, "1", {
+ get: function () {
+ throw new RangeError("unhandle exception happened in getter");
+ },
+ configurable: true
+ });
+
+ try {
+ arr.reduce(callbackfn, initialValue);
+ return false;
+ } catch (ex) {
+ return (ex instanceof RangeError) && !accessed && !testResult;
+ }
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce) && fnExists(Object.defineProperty) && fnSupportsArrayIndexGettersOnArrays();
+ }
+
+}); \ No newline at end of file
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-4.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-4.js
new file mode 100644
index 000000000..130edc01c
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-4.js
@@ -0,0 +1,54 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-9-c-i-4",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-4.js",
+
+ description: "Array.prototype.reduce - element to be retrieved is own data property that overrides an inherited data property on an Array",
+
+ test: function testcase() {
+
+ var testResult = false;
+ var initialValue = 0;
+ function callbackfn(prevVal, curVal, idx, obj) {
+ if (idx === 1) {
+ testResult = (curVal === 1);
+ }
+ }
+
+ try {
+ Array.prototype[1] = "3";
+ [0, 1, 2].reduce(callbackfn, initialValue);
+ return testResult;
+ } finally {
+ delete Array.prototype[1];
+ }
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-5.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-5.js
new file mode 100644
index 000000000..b5b7362c1
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-5.js
@@ -0,0 +1,71 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-9-c-i-5",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-5.js",
+
+ description: "Array.prototype.reduce - element to be retrieved is own data property that overrides an inherited accessor property on an Array-like object",
+
+ test: function testcase() {
+
+ var testResult = false;
+ var initialValue = 0;
+ function callbackfn(prevVal, curVal, idx, obj) {
+ if (idx === 0) {
+ testResult = (curVal === "9");
+ }
+ }
+
+ var proto = {};
+
+ Object.defineProperty(proto, "0", {
+ get: function () {
+ return 0;
+ },
+ configurable: true
+ });
+
+ var Con = function () { };
+ Con.prototype = proto;
+
+ var child = new Con();
+ child.length = 2;
+
+ Object.defineProperty(child, "0", {
+ value: "9",
+ configurable: true
+ });
+
+ child[1] = "1";
+
+ Array.prototype.reduce.call(child, callbackfn, initialValue);
+ return testResult;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce) && fnExists(Object.defineProperty) && fnSupportsArrayIndexGettersOnObjects();
+ }
+
+}); \ No newline at end of file
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-6.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-6.js
new file mode 100644
index 000000000..39fa98ca7
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-6.js
@@ -0,0 +1,61 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-9-c-i-6",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-6.js",
+
+ description: "Array.prototype.reduce - element to be retrieved is own data property that overrides an inherited accessor property on an Array",
+
+ test: function testcase() {
+
+ var testResult = false;
+ var initialValue = 0;
+ function callbackfn(prevVal, curVal, idx, obj) {
+ if (idx === 1) {
+ testResult = (curVal === 1);
+ }
+ }
+
+ try {
+ Object.defineProperty(Array.prototype, "1", {
+ get: function () {
+ return "9";
+ },
+ configurable: true
+ });
+ [0, 1, 2].reduce(callbackfn, initialValue);
+ return testResult;
+
+ } finally {
+ delete Array.prototype[1];
+ }
+
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce) && fnExists(Object.defineProperty) && fnSupportsArrayIndexGettersOnArrays();
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-7.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-7.js
new file mode 100644
index 000000000..fa2cf1e83
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-7.js
@@ -0,0 +1,56 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-9-c-i-7",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-7.js",
+
+ description: "Array.prototype.reduce - element to be retrieved is inherited data property on an Array-like object",
+
+ test: function testcase() {
+
+ var testResult = false;
+ var initialValue = 0;
+ function callbackfn(prevVal, curVal, idx, obj) {
+ if (idx === 1) {
+ testResult = (curVal === 1);
+ }
+ }
+
+ var proto = { 0: 0, 1: 1, 2: 2, length: 3 };
+ var Con = function () { };
+ Con.prototype = proto;
+
+ var child = new Con();
+ child.length = 3;
+
+ Array.prototype.reduce.call(child, callbackfn, initialValue);
+ return testResult;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-8.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-8.js
new file mode 100644
index 000000000..b371ffcb2
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-8.js
@@ -0,0 +1,59 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-9-c-i-8",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-8.js",
+
+ description: "Array.prototype.reduce - element to be retrieved is inherited data property on an Array",
+
+ test: function testcase() {
+
+ var testResult = false;
+ var initialValue = 0;
+ function callbackfn(prevVal, curVal, idx, obj) {
+ if (idx === 1) {
+ testResult = (curVal === 1);
+ }
+ }
+
+ try {
+ Array.prototype[0] = 0;
+ Array.prototype[1] = 1;
+ Array.prototype[2] = 2;
+ [, , , ].reduce(callbackfn, initialValue);
+
+ return testResult;
+ } finally {
+ delete Array.prototype[0];
+ delete Array.prototype[1];
+ delete Array.prototype[2];
+ }
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce) && ![, 1].hasOwnProperty(0);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-9.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-9.js
new file mode 100644
index 000000000..595e7564a
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-9.js
@@ -0,0 +1,58 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-9-c-i-9",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-9.js",
+
+ description: "Array.prototype.reduce - element to be retrieved is own accessor property on an Array-like object",
+
+ test: function testcase() {
+
+ var testResult = false;
+ var initialValue = 0;
+ function callbackfn(prevVal, curVal, idx, obj) {
+ if (idx === 1) {
+ testResult = (curVal === 1);
+ }
+ }
+
+ var obj = { 0: 0, 2: 2, length: 3 };
+ Object.defineProperty(obj, "1", {
+ get: function () {
+ return 1;
+ },
+ configurable: true
+ });
+
+ Array.prototype.reduce.call(obj, callbackfn, initialValue);
+ return testResult;
+
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce) && fnExists(Object.defineProperty) && fnSupportsArrayIndexGettersOnObjects();
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-1.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-1.js
new file mode 100644
index 000000000..f5ddc8b94
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-1.js
@@ -0,0 +1,47 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.4.4.21-9-c-ii-1",
+
+path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-1.js",
+
+description: "Array.prototype.reduce - callbackfn called with correct parameters (initialvalue not passed)",
+
+test: function testcase() {
+
+ function callbackfn(prevVal, curVal, idx, obj)
+ {
+ if(idx > 0 && obj[idx] === curVal && obj[idx-1] === prevVal)
+ return curVal;
+ else
+ return false;
+ }
+
+ var arr = [0,1,true,null,new Object(),"five"];
+ if( arr.reduce(callbackfn) === "five")
+ return true;
+ },
+
+precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-10.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-10.js
new file mode 100644
index 000000000..b5c533a6d
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-10.js
@@ -0,0 +1,46 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-9-c-ii-10",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-10.js",
+
+ description: "Array.prototype.reduce - callbackfn is called with 1 formal parameter",
+
+ test: function testcase() {
+
+ var result = false;
+ function callbackfn(prevVal) {
+ result = (prevVal === 1);
+ }
+
+ [11].reduce(callbackfn, 1);
+ return result;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-11.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-11.js
new file mode 100644
index 000000000..60f5fcf07
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-11.js
@@ -0,0 +1,46 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-9-c-ii-11",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-11.js",
+
+ description: "Array.prototype.reduce - callbackfn is called with 2 formal parameter",
+
+ test: function testcase() {
+
+ var result = false;
+ function callbackfn(prevVal, curVal) {
+ result = (curVal > 10 && 1 === prevVal);
+ }
+
+ [11].reduce(callbackfn, 1);
+ return result;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-12.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-12.js
new file mode 100644
index 000000000..50d010e39
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-12.js
@@ -0,0 +1,46 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-9-c-ii-12",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-12.js",
+
+ description: "Array.prototype.reduce - callbackfn is called with 3 formal parameter",
+
+ test: function testcase() {
+
+ var result = false;
+ function callbackfn(prevVal, curVal, idx) {
+ result = (prevVal === 1 && arguments[3][idx] === curVal);
+ }
+
+ [11].reduce(callbackfn, 1);
+ return result;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-13.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-13.js
new file mode 100644
index 000000000..f08442b3c
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-13.js
@@ -0,0 +1,46 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-9-c-ii-13",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-13.js",
+
+ description: "Array.prototype.reduce - callbackfn is called with 4 formal parameter",
+
+ test: function testcase() {
+
+ var result = false;
+ function callbackfn(prevVal, curVal, idx, obj) {
+ result = (prevVal === 1 && obj[idx] === curVal);
+ }
+
+ [11].reduce(callbackfn, 1);
+ return result;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-14.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-14.js
new file mode 100644
index 000000000..c621fd9b5
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-14.js
@@ -0,0 +1,46 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-9-c-ii-14",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-14.js",
+
+ description: "Array.prototype.reduce - callbackfn that uses arguments",
+
+ test: function testcase() {
+
+ var result = false;
+ function callbackfn() {
+ result = (arguments[0] === 1 && arguments[3][arguments[2]] === arguments[1]);
+ }
+
+ [11].reduce(callbackfn, 1);
+ return result;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-16.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-16.js
new file mode 100644
index 000000000..19dab7581
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-16.js
@@ -0,0 +1,58 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-9-c-ii-16",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-16.js",
+
+ description: "Array.prototype.reduce - non-indexed properties are not called",
+
+ test: function testcase() {
+
+ var accessed = false;
+ var result1 = true;
+ var result2 = true;
+
+ function callbackfn(prevVal, curVal, idx, obj) {
+ accessed = true;
+ if (curVal === 8) {
+ result1 = false;
+ }
+
+ if (prevVal === 8) {
+ result2 = false;
+ }
+ }
+
+ var obj = { 0: 11, 10: 12, non_index_property: 8, length: 20 };
+
+ Array.prototype.reduce.call(obj, callbackfn, 1);
+ return result1 && result2 && accessed;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-17.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-17.js
new file mode 100644
index 000000000..156ea72ec
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-17.js
@@ -0,0 +1,53 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-9-c-ii-17",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-17.js",
+
+ description: "Array.prototype.reduce - 'accumulator' used for current iteration is the result of previous iteration on an Array",
+
+ test: function testcase() {
+
+ var result = true;
+ var accessed = false;
+ var preIteration = 1;
+ function callbackfn(prevVal, curVal, idx, obj) {
+ accessed = true;
+ if (preIteration !== prevVal) {
+ result = false;
+ }
+ preIteration = curVal;
+ return curVal;
+ }
+
+ [11, 12, 13].reduce(callbackfn, 1);
+ return result && accessed;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-18.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-18.js
new file mode 100644
index 000000000..444b52350
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-18.js
@@ -0,0 +1,50 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-9-c-ii-18",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-18.js",
+
+ description: "Array.prototype.reduce - value of 'accumulator' used for first iteration is the value of 'initialValue' when it is present on an Array-like object",
+
+ test: function testcase() {
+
+ var result = false;
+ function callbackfn(prevVal, curVal, idx, obj) {
+ if (idx === 0) {
+ result = (arguments[0] === 1);
+ }
+ }
+
+ var obj = { 0: 11, 1: 9, length: 2 };
+
+ Array.prototype.reduce.call(obj, callbackfn, 1);
+ return result;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-19.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-19.js
new file mode 100644
index 000000000..0e9554878
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-19.js
@@ -0,0 +1,50 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-9-c-ii-19",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-19.js",
+
+ description: "Array.prototype.reduce - value of 'accumulator' used for first iteration is the value of least index property which is not undefined when 'initialValue' is not present on an Array",
+
+ test: function testcase() {
+
+ var called = 0;
+ var result = false;
+ function callbackfn(prevVal, curVal, idx, obj) {
+ called++;
+ if (idx === 1) {
+ result = (prevVal === 11) && curVal === 9;
+ }
+ }
+
+ [11, 9].reduce(callbackfn);
+ return result && called === 1;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-2.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-2.js
new file mode 100644
index 000000000..88b9c9477
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-2.js
@@ -0,0 +1,51 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.4.4.21-9-c-ii-2",
+
+path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-2.js",
+
+description: "Array.prototype.reduce - callbackfn called with correct parameters (initialvalue passed)",
+
+test: function testcase() {
+
+ var bParCorrect = false;
+ function callbackfn(prevVal, curVal, idx, obj)
+ {
+ if(idx === 0 && obj[idx] === curVal && prevVal === initialValue)
+ return curVal;
+ else if(idx > 0 && obj[idx] === curVal && obj[idx-1] === prevVal)
+ return curVal;
+ else
+ return false;
+ }
+
+ var arr = [0,1,true,null,new Object(),"five"];
+ var initialValue = 5.5;
+ if( arr.reduce(callbackfn,initialValue) === "five")
+ return true;
+ },
+
+precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-20.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-20.js
new file mode 100644
index 000000000..885e1a937
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-20.js
@@ -0,0 +1,48 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-9-c-ii-20",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-20.js",
+
+ description: "Array.prototype.reduce - undefined can be used as accumulator",
+
+ test: function testcase() {
+
+ var accessed = false;
+ function callbackfn(prevVal, curVal, idx, obj) {
+ accessed = true;
+ return typeof prevVal === "undefined";
+ }
+
+ var obj = { 0: 11, length: 1 };
+
+ return Array.prototype.reduce.call(obj, callbackfn, undefined) === true && accessed;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-21.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-21.js
new file mode 100644
index 000000000..b3860ccfc
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-21.js
@@ -0,0 +1,48 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-9-c-ii-21",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-21.js",
+
+ description: "Array.prototype.reduce - null can be used as accumulator",
+
+ test: function testcase() {
+
+ var accessed = false;
+ function callbackfn(prevVal, curVal, idx, obj) {
+ accessed = true;
+ return prevVal === null;
+ }
+
+ var obj = { 0: 11, length: 1 };
+
+ return Array.prototype.reduce.call(obj, callbackfn, null) === true && accessed;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-22.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-22.js
new file mode 100644
index 000000000..7081d51a2
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-22.js
@@ -0,0 +1,48 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-9-c-ii-22",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-22.js",
+
+ description: "Array.prototype.reduce - boolean primitive can be used as accumulator",
+
+ test: function testcase() {
+
+ var accessed = false;
+ function callbackfn(prevVal, curVal, idx, obj) {
+ accessed = true;
+ return prevVal === false;
+ }
+
+ var obj = { 0: 11, length: 1 };
+
+ return Array.prototype.reduce.call(obj, callbackfn, false) === true && accessed;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-23.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-23.js
new file mode 100644
index 000000000..793ef5d0b
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-23.js
@@ -0,0 +1,48 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-9-c-ii-23",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-23.js",
+
+ description: "Array.prototype.reduce - number primitive can be used as accumulator",
+
+ test: function testcase() {
+
+ var accessed = false;
+ function callbackfn(prevVal, curVal, idx, obj) {
+ accessed = true;
+ return prevVal === 12;
+ }
+
+ var obj = { 0: 11, length: 1 };
+
+ return Array.prototype.reduce.call(obj, callbackfn, 12) === true && accessed;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-24.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-24.js
new file mode 100644
index 000000000..e5f183c83
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-24.js
@@ -0,0 +1,48 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-9-c-ii-24",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-24.js",
+
+ description: "Array.prototype.reduce - string primitive can be used as accumulator",
+
+ test: function testcase() {
+
+ var accessed = false;
+ function callbackfn(prevVal, curVal, idx, obj) {
+ accessed = true;
+ return prevVal === "hello_";
+ }
+
+ var obj = { 0: 11, length: 1 };
+
+ return Array.prototype.reduce.call(obj, callbackfn, "hello_") === true && accessed;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-25.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-25.js
new file mode 100644
index 000000000..6e7c8ba83
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-25.js
@@ -0,0 +1,50 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-9-c-ii-25",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-25.js",
+
+ description: "Array.prototype.reduce - Function object can be used as accumulator",
+
+ test: function testcase() {
+
+ var objFunction = function () { };
+
+ var accessed = false;
+ function callbackfn(prevVal, curVal, idx, obj) {
+ accessed = true;
+ return prevVal === objFunction;
+ }
+
+ var obj = { 0: 11, length: 1 };
+
+ return Array.prototype.reduce.call(obj, callbackfn, objFunction) === true && accessed;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-26.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-26.js
new file mode 100644
index 000000000..eec31b47f
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-26.js
@@ -0,0 +1,50 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-9-c-ii-26",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-26.js",
+
+ description: "Array.prototype.reduce - Array object can be used as accumulator",
+
+ test: function testcase() {
+
+ var objArray = new Array(10);
+
+ var accessed = false;
+ function callbackfn(prevVal, curVal, idx, obj) {
+ accessed = true;
+ return prevVal === objArray;
+ }
+
+ var obj = { 0: 11, length: 1 };
+
+ return Array.prototype.reduce.call(obj, callbackfn, objArray) === true && accessed;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-27.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-27.js
new file mode 100644
index 000000000..925232e42
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-27.js
@@ -0,0 +1,50 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-9-c-ii-27",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-27.js",
+
+ description: "Array.prototype.reduce - String object can be used as accumulator",
+
+ test: function testcase() {
+
+ var objString = new String();
+
+ var accessed = false;
+ function callbackfn(prevVal, curVal, idx, obj) {
+ accessed = true;
+ return prevVal === objString;
+ }
+
+ var obj = { 0: 11, length: 1 };
+
+ return Array.prototype.reduce.call(obj, callbackfn, objString) === true && accessed;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-28.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-28.js
new file mode 100644
index 000000000..936f05772
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-28.js
@@ -0,0 +1,50 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-9-c-ii-28",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-28.js",
+
+ description: "Array.prototype.reduce - Boolean object can be used as accumulator",
+
+ test: function testcase() {
+
+ var objBoolean = new Boolean();
+
+ var accessed = false;
+ function callbackfn(prevVal, curVal, idx, obj) {
+ accessed = true;
+ return prevVal === objBoolean;
+ }
+
+ var obj = { 0: 11, length: 1 };
+
+ return Array.prototype.reduce.call(obj, callbackfn, objBoolean) === true && accessed;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-29.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-29.js
new file mode 100644
index 000000000..ae3e49d4f
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-29.js
@@ -0,0 +1,50 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-9-c-ii-29",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-29.js",
+
+ description: "Array.prototype.reduce - Number object can be used as accumulator",
+
+ test: function testcase() {
+
+ var objNumber = new Number();
+
+ var accessed = false;
+ function callbackfn(prevVal, curVal, idx, obj) {
+ accessed = true;
+ return prevVal === objNumber;
+ }
+
+ var obj = { 0: 11, length: 1 };
+
+ return Array.prototype.reduce.call(obj, callbackfn, objNumber) === true && accessed;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-3.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-3.js
new file mode 100644
index 000000000..a9d5daa5a
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-3.js
@@ -0,0 +1,48 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ES5Harness.registerTest( {
+id: "15.4.4.21-9-c-ii-3",
+
+path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-3.js",
+
+description: "Array.prototype.reduce - callbackfn takes 4 arguments",
+
+test: function testcase() {
+
+ var bCalled = false;
+ function callbackfn(prevVal, curVal, idx, obj)
+ {
+ bCalled = true;
+ if(prevVal === true && arguments.length === 4)
+ return true;
+ else
+ return false;
+ }
+ var arr = [0,1,2,3,4,5,6,7,8,9];
+ if(arr.reduce(callbackfn,true) === true && bCalled === true)
+ return true;
+ },
+
+precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-30.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-30.js
new file mode 100644
index 000000000..1efa0566a
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-30.js
@@ -0,0 +1,48 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-9-c-ii-30",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-30.js",
+
+ description: "Array.prototype.reduce - the Math object can be used as accumulator",
+
+ test: function testcase() {
+
+ var accessed = false;
+ function callbackfn(prevVal, curVal, idx, obj) {
+ accessed = true;
+ return prevVal === Math;
+ }
+
+ var obj = { 0: 11, length: 1 };
+
+ return Array.prototype.reduce.call(obj, callbackfn, Math) === true && accessed;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-31.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-31.js
new file mode 100644
index 000000000..06d1adf65
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-31.js
@@ -0,0 +1,50 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-9-c-ii-31",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-31.js",
+
+ description: "Array.prototype.reduce - Date object can be used as accumulator",
+
+ test: function testcase() {
+
+ var objDate = new Date();
+
+ var accessed = false;
+ function callbackfn(prevVal, curVal, idx, obj) {
+ accessed = true;
+ return prevVal === objDate;
+ }
+
+ var obj = { 0: 11, length: 1 };
+
+ return Array.prototype.reduce.call(obj, callbackfn, objDate) === true && accessed;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-32.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-32.js
new file mode 100644
index 000000000..34a65c21b
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-32.js
@@ -0,0 +1,50 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-9-c-ii-32",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-32.js",
+
+ description: "Array.prototype.reduce - RegExp object can be used as accumulator",
+
+ test: function testcase() {
+
+ var objRegExp = new RegExp();
+
+ var accessed = false;
+ function callbackfn(prevVal, curVal, idx, obj) {
+ accessed = true;
+ return prevVal === objRegExp;
+ }
+
+ var obj = { 0: 11, length: 1 };
+
+ return Array.prototype.reduce.call(obj, callbackfn, objRegExp) === true && accessed;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-33.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-33.js
new file mode 100644
index 000000000..46643f724
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-33.js
@@ -0,0 +1,48 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-9-c-ii-33",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-33.js",
+
+ description: "Array.prototype.reduce - the JSON can be used as accumulator",
+
+ test: function testcase() {
+
+ var accessed = false;
+ function callbackfn(prevVal, curVal, idx, obj) {
+ accessed = true;
+ return prevVal === JSON;
+ }
+
+ var obj = { 0: 11, length: 1 };
+
+ return Array.prototype.reduce.call(obj, callbackfn, JSON) === true && accessed;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-34.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-34.js
new file mode 100644
index 000000000..d6917b4d1
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-34.js
@@ -0,0 +1,50 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-9-c-ii-34",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-34.js",
+
+ description: "Array.prototype.reduce - Error object can be used as accumulator",
+
+ test: function testcase() {
+
+ var objError = new RangeError();
+
+ var accessed = false;
+ function callbackfn(prevVal, curVal, idx, obj) {
+ accessed = true;
+ return prevVal === objError;
+ }
+
+ var obj = { 0: 11, length: 1 };
+
+ return Array.prototype.reduce.call(obj, callbackfn, objError) === true && accessed;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-35.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-35.js
new file mode 100644
index 000000000..c73afa8ea
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-35.js
@@ -0,0 +1,54 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-9-c-ii-35",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-35.js",
+
+ description: "Array.prototype.reduce - the Arguments object can be used as accumulator",
+
+ test: function testcase() {
+
+ var accessed = false;
+ var arg;
+
+ function callbackfn(prevVal, curVal, idx, obj) {
+ accessed = true;
+ return prevVal === arg;
+ }
+
+ var obj = { 0: 11, length: 1 };
+
+ (function fun() {
+ arg = arguments;
+ }(10, 11, 12, 13));
+
+ return Array.prototype.reduce.call(obj, callbackfn, arg) === true && accessed;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-37.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-37.js
new file mode 100644
index 000000000..4d5c32fa9
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-37.js
@@ -0,0 +1,48 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-9-c-ii-37",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-37.js",
+
+ description: "Array.prototype.reduce - the global object can be used as accumulator",
+
+ test: function testcase() {
+
+ var accessed = false;
+ function callbackfn(prevVal, curVal, idx, obj) {
+ accessed = true;
+ return prevVal === fnGlobalObject();
+ }
+
+ var obj = { 0: 11, length: 1 };
+
+ return Array.prototype.reduce.call(obj, callbackfn, fnGlobalObject()) === true && accessed;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-4-s.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-4-s.js
new file mode 100644
index 000000000..d267daf49
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-4-s.js
@@ -0,0 +1,48 @@
+/// Copyright (c) 2010 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest( {
+id: "15.4.4.21-9-c-ii-4-s",
+
+path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-4-s.js",
+
+description: "Array.prototype.reduce - undefined passed as thisValue to strict callbackfn",
+//ES5 Errata, undefined in step 9.c.ii as thisValue is supposed to be undefined
+
+test: function testcase() {
+ var innerThisCorrect = false;
+ function callbackfn(prevVal, curVal, idx, obj)
+ {
+ "use strict";
+ innerThisCorrect = this===undefined;
+ return true;
+ }
+ [0].reduce(callbackfn,true);
+ return innerThisCorrect;
+ },
+
+strict:1,
+
+precondition: function prereq() {
+ return fnSupportsStrict() && fnExists(Array.prototype.reduce);
+ }
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-4.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-4.js
new file mode 100644
index 000000000..c8903841e
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-4.js
@@ -0,0 +1,55 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-9-c-ii-4",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-4.js",
+
+ description: "Array.prototype.reduce - k values are passed in acending numeric order on an Array",
+
+ test: function testcase() {
+
+ var arr = [0, 1, 2];
+ var lastIdx = 0;
+ var result = true;
+ var accessed = false;
+
+ function callbackfn(prevVal, curVal, idx, obj) {
+ accessed = true;
+ if (lastIdx !== idx) {
+ result = false;
+ } else {
+ lastIdx++;
+ }
+ }
+
+ arr.reduce(callbackfn, 11);
+ return result && accessed;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-5.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-5.js
new file mode 100644
index 000000000..8e291d29b
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-5.js
@@ -0,0 +1,62 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-9-c-ii-5",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-5.js",
+
+ description: "Array.prototype.reduce - k values are accessed during each iteration and not prior to starting the loop on an Array",
+
+ test: function testcase() {
+
+ var result = true;
+ var kIndex = [];
+ var called = 0;
+
+ //By below way, we could verify that k would be setted as 0, 1, ..., length - 1 in order, and each value will be setted one time.
+ function callbackfn(prevVal, curVal, idx, obj) {
+ //Each position should be visited one time, which means k is accessed one time during iterations.
+ called++;
+ if (typeof kIndex[idx] === "undefined") {
+ //when current position is visited, its previous index should has been visited.
+ if (idx !== 0 && typeof kIndex[idx - 1] === "undefined") {
+ result = false;
+ }
+ kIndex[idx] = 1;
+ } else {
+ result = false;
+ }
+ }
+
+ [11, 12, 13, 14].reduce(callbackfn, 1);
+
+ return result && called === 4;
+ },
+
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-7.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-7.js
new file mode 100644
index 000000000..34a32b1de
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-7.js
@@ -0,0 +1,58 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-9-c-ii-7",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-7.js",
+
+ description: "Array.prototype.reduce - unhandled exceptions happened in callbackfn terminate iteration",
+
+ test: function testcase() {
+
+ var accessed = false;
+
+ function callbackfn(prevVal, curVal, idx, obj) {
+ if (idx > 0) {
+ accessed = true;
+ }
+ if (idx === 0) {
+ throw new Error("Exception occurred in callbackfn");
+ }
+ }
+
+ var obj = { 0: 11, 4: 10, 10: 8, length: 20 };
+
+ try {
+ Array.prototype.reduce.call(obj, callbackfn, 1);
+ return false;
+ } catch (ex) {
+ return (ex instanceof Error) && !accessed;
+ }
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-8.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-8.js
new file mode 100644
index 000000000..97df29d49
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-8.js
@@ -0,0 +1,54 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-9-c-ii-8",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-8.js",
+
+ description: "Array.prototype.reduce - element changed by callbackfn on previous iterations is observed",
+
+ test: function testcase() {
+
+ var result = false;
+ function callbackfn(prevVal, curVal, idx, obj) {
+ if (idx === 0) {
+ obj[idx + 1] = 8;
+ }
+
+ if (idx === 1) {
+ result = (curVal === 8);
+ }
+ }
+
+ var obj = { 0: 11, 1: 12, length: 2 };
+
+ Array.prototype.reduce.call(obj, callbackfn, 1);
+ return result;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+
+});
diff --git a/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-9.js b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-9.js
new file mode 100644
index 000000000..6419914a6
--- /dev/null
+++ b/external/contributions/Microsoft/ietestcenter_build_2011/TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-9.js
@@ -0,0 +1,46 @@
+/// Copyright (c) 2009 Microsoft Corporation
+///
+/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
+/// that the following conditions are met:
+/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
+/// the following disclaimer.
+/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+/// the following disclaimer in the documentation and/or other materials provided with the distribution.
+/// * Neither the name of Microsoft nor the names of its contributors may be used to
+/// endorse or promote products derived from this software without specific prior written permission.
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ES5Harness.registerTest({
+
+ id: "15.4.4.21-9-c-ii-9",
+
+ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-9.js",
+
+ description: "Array.prototype.reduce - callbackfn is called with 0 formal parameter",
+
+ test: function testcase() {
+
+ var called = 0;
+ function callbackfn() {
+ called++;
+ }
+
+ [11, 12].reduce(callbackfn, 1);
+ return 2 === called;
+ },
+
+ precondition: function prereq() {
+ return fnExists(Array.prototype.reduce);
+ }
+
+});