JavaScript Test Library - apply with null this parameter passes the global object as this, bug 306591

This commit is contained in:
bclary%bclary.com 2006-04-26 06:33:40 +00:00
Родитель 1f1d7e8dfa
Коммит 75f2a4882b
1 изменённых файлов: 4 добавлений и 2 удалений

Просмотреть файл

@ -59,7 +59,8 @@ actual = String.toUpperCase(new Boolean(true));
reportCompare(expect, actual, summary +
" String.toUpperCase(new Boolean(true))");
expect = 2;
// null means the global object is passed
expect = (typeof window == 'undefined') ? 9 : -1;
actual = String.indexOf(null, 'l');
reportCompare(expect, actual, summary +
" String.indexOf(null, 'l')");
@ -84,7 +85,8 @@ actual = String.toUpperCase(true);
reportCompare(expect, actual, summary +
" String.toUpperCase(true)");
expect = 2;
// null means the global object is passed
expect = (typeof window == 'undefined') ? -1 : 11;
actual = String.indexOf(undefined, 'd');
reportCompare(expect, actual, summary +
" String.indexOf(undefined, 'd')");