oliver@apple.com | 6bfc34a | 2008-07-21 01:37:38 +0000 | [diff] [blame] | 1 | This test exercises the source expression offset information that is attached to exception objects for the inspector. |
| 2 | |
| 3 | On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". |
| 4 | |
| 5 | |
| 6 | |
| 7 | Testing 'undefined.a++' |
commit-queue@webkit.org | 31924df | 2016-10-14 06:31:40 +0000 | [diff] [blame] | 8 | PASS ex.message is "undefined is not an object (evaluating 'undefined.a')" |
oliver@apple.com | 6bfc34a | 2008-07-21 01:37:38 +0000 | [diff] [blame] | 9 | |
| 10 | Testing '++undefined.a' |
commit-queue@webkit.org | 31924df | 2016-10-14 06:31:40 +0000 | [diff] [blame] | 11 | PASS ex.message is "undefined is not an object (evaluating 'undefined.a')" |
oliver@apple.com | 6bfc34a | 2008-07-21 01:37:38 +0000 | [diff] [blame] | 12 | |
| 13 | Testing 'undefined[0]++' |
commit-queue@webkit.org | 31924df | 2016-10-14 06:31:40 +0000 | [diff] [blame] | 14 | PASS ex.message is "undefined is not an object (evaluating 'undefined[0]')" |
oliver@apple.com | 6bfc34a | 2008-07-21 01:37:38 +0000 | [diff] [blame] | 15 | |
| 16 | Testing '++undefined[1]' |
commit-queue@webkit.org | 31924df | 2016-10-14 06:31:40 +0000 | [diff] [blame] | 17 | PASS ex.message is "undefined is not an object (evaluating 'undefined[1]')" |
oliver@apple.com | 6bfc34a | 2008-07-21 01:37:38 +0000 | [diff] [blame] | 18 | |
| 19 | Testing 'undefined.b' |
commit-queue@webkit.org | 31924df | 2016-10-14 06:31:40 +0000 | [diff] [blame] | 20 | PASS ex.message is "undefined is not an object (evaluating 'undefined.b')" |
oliver@apple.com | 6bfc34a | 2008-07-21 01:37:38 +0000 | [diff] [blame] | 21 | |
| 22 | Testing 'undefined[0]' |
commit-queue@webkit.org | 31924df | 2016-10-14 06:31:40 +0000 | [diff] [blame] | 23 | PASS ex.message is "undefined is not an object (evaluating 'undefined[0]')" |
oliver@apple.com | 6bfc34a | 2008-07-21 01:37:38 +0000 | [diff] [blame] | 24 | |
| 25 | Testing 'undefined.b += 1' |
commit-queue@webkit.org | 31924df | 2016-10-14 06:31:40 +0000 | [diff] [blame] | 26 | PASS ex.message is "undefined is not an object (evaluating 'undefined.b')" |
oliver@apple.com | 6bfc34a | 2008-07-21 01:37:38 +0000 | [diff] [blame] | 27 | |
| 28 | Testing 'undefined[0] += 1' |
commit-queue@webkit.org | 31924df | 2016-10-14 06:31:40 +0000 | [diff] [blame] | 29 | PASS ex.message is "undefined is not an object (evaluating 'undefined[0]')" |
oliver@apple.com | 6bfc34a | 2008-07-21 01:37:38 +0000 | [diff] [blame] | 30 | |
| 31 | Testing 'undefined()' |
commit-queue@webkit.org | 31924df | 2016-10-14 06:31:40 +0000 | [diff] [blame] | 32 | PASS ex.message is "undefined is not a function. (In 'undefined()', 'undefined' is undefined)" |
oliver@apple.com | 6bfc34a | 2008-07-21 01:37:38 +0000 | [diff] [blame] | 33 | |
| 34 | Testing 'new undefined()' |
commit-queue@webkit.org | 31924df | 2016-10-14 06:31:40 +0000 | [diff] [blame] | 35 | PASS ex.message is "undefined is not a constructor (evaluating 'new undefined()')" |
oliver@apple.com | 6bfc34a | 2008-07-21 01:37:38 +0000 | [diff] [blame] | 36 | |
| 37 | Testing '({}).b()' |
commit-queue@webkit.org | 31924df | 2016-10-14 06:31:40 +0000 | [diff] [blame] | 38 | PASS ex.message is "({}).b is not a function. (In '({}).b()', '({}).b' is undefined)" |
oliver@apple.com | 6bfc34a | 2008-07-21 01:37:38 +0000 | [diff] [blame] | 39 | |
| 40 | Testing 'new {}.b()' |
commit-queue@webkit.org | 31924df | 2016-10-14 06:31:40 +0000 | [diff] [blame] | 41 | PASS ex.message is "undefined is not a constructor (evaluating 'new {}.b()')" |
oliver@apple.com | 6bfc34a | 2008-07-21 01:37:38 +0000 | [diff] [blame] | 42 | |
| 43 | Testing '1()' |
commit-queue@webkit.org | 31924df | 2016-10-14 06:31:40 +0000 | [diff] [blame] | 44 | PASS ex.message is "1 is not a function. (In '1()', '1' is 1)" |
oliver@apple.com | 6bfc34a | 2008-07-21 01:37:38 +0000 | [diff] [blame] | 45 | |
| 46 | Testing 'new 1()' |
commit-queue@webkit.org | 31924df | 2016-10-14 06:31:40 +0000 | [diff] [blame] | 47 | PASS ex.message is "1 is not a constructor (evaluating 'new 1()')" |
oliver@apple.com | 6bfc34a | 2008-07-21 01:37:38 +0000 | [diff] [blame] | 48 | |
| 49 | Testing 'throw { message : 'thrown object' }' |
commit-queue@webkit.org | 31924df | 2016-10-14 06:31:40 +0000 | [diff] [blame] | 50 | PASS ex.message is "thrown object" |
oliver@apple.com | 6bfc34a | 2008-07-21 01:37:38 +0000 | [diff] [blame] | 51 | |
| 52 | Testing '1 in undefined' |
commit-queue@webkit.org | 31924df | 2016-10-14 06:31:40 +0000 | [diff] [blame] | 53 | PASS ex.message is "undefined is not an Object. (evaluating '1 in undefined')" |
oliver@apple.com | 6bfc34a | 2008-07-21 01:37:38 +0000 | [diff] [blame] | 54 | |
| 55 | Testing '1 instanceof undefined' |
commit-queue@webkit.org | 31924df | 2016-10-14 06:31:40 +0000 | [diff] [blame] | 56 | PASS ex.message is "Right hand side of instanceof is not an object" |
oliver@apple.com | 6bfc34a | 2008-07-21 01:37:38 +0000 | [diff] [blame] | 57 | |
| 58 | Testing 'for (undefined.b in [1]) {}' |
commit-queue@webkit.org | 31924df | 2016-10-14 06:31:40 +0000 | [diff] [blame] | 59 | PASS ex.message is "undefined is not an object (evaluating 'undefined.b')" |
oliver@apple.com | 6bfc34a | 2008-07-21 01:37:38 +0000 | [diff] [blame] | 60 | |
| 61 | Testing 'for (undefined[0] in [1]) {}' |
commit-queue@webkit.org | 31924df | 2016-10-14 06:31:40 +0000 | [diff] [blame] | 62 | PASS ex.message is "undefined is not an object (evaluating 'undefined[0]')" |
oliver@apple.com | 6bfc34a | 2008-07-21 01:37:38 +0000 | [diff] [blame] | 63 | |
| 64 | Testing 'undefined.a = 5' |
commit-queue@webkit.org | 31924df | 2016-10-14 06:31:40 +0000 | [diff] [blame] | 65 | PASS ex.message is "undefined is not an object (evaluating 'undefined.a = 5')" |
oliver@apple.com | 6bfc34a | 2008-07-21 01:37:38 +0000 | [diff] [blame] | 66 | |
| 67 | Testing 'undefined[0] = 5' |
commit-queue@webkit.org | 31924df | 2016-10-14 06:31:40 +0000 | [diff] [blame] | 68 | PASS ex.message is "undefined is not an object (evaluating 'undefined[0] = 5')" |
oliver@apple.com | 6bfc34a | 2008-07-21 01:37:38 +0000 | [diff] [blame] | 69 | |
| 70 | Testing '({b:undefined}).b.a = 5' |
commit-queue@webkit.org | 31924df | 2016-10-14 06:31:40 +0000 | [diff] [blame] | 71 | PASS ex.message is "undefined is not an object (evaluating '({b:undefined}).b.a = 5')" |
oliver@apple.com | 6bfc34a | 2008-07-21 01:37:38 +0000 | [diff] [blame] | 72 | |
| 73 | Testing '({b:undefined}).b[0] = 5' |
commit-queue@webkit.org | 31924df | 2016-10-14 06:31:40 +0000 | [diff] [blame] | 74 | PASS ex.message is "undefined is not an object (evaluating '({b:undefined}).b[0] = 5')" |
oliver@apple.com | 6bfc34a | 2008-07-21 01:37:38 +0000 | [diff] [blame] | 75 | |
| 76 | Testing 'undefined.a += 5' |
commit-queue@webkit.org | 31924df | 2016-10-14 06:31:40 +0000 | [diff] [blame] | 77 | PASS ex.message is "undefined is not an object (evaluating 'undefined.a')" |
oliver@apple.com | 6bfc34a | 2008-07-21 01:37:38 +0000 | [diff] [blame] | 78 | |
| 79 | Testing 'undefined[0] += 5' |
commit-queue@webkit.org | 31924df | 2016-10-14 06:31:40 +0000 | [diff] [blame] | 80 | PASS ex.message is "undefined is not an object (evaluating 'undefined[0]')" |
oliver@apple.com | 6bfc34a | 2008-07-21 01:37:38 +0000 | [diff] [blame] | 81 | |
| 82 | Testing '({b:undefined}).b.a += 5' |
commit-queue@webkit.org | 31924df | 2016-10-14 06:31:40 +0000 | [diff] [blame] | 83 | PASS ex.message is "undefined is not an object (evaluating '({b:undefined}).b.a')" |
oliver@apple.com | 6bfc34a | 2008-07-21 01:37:38 +0000 | [diff] [blame] | 84 | |
| 85 | Testing '({b:undefined}).b[0] += 5' |
commit-queue@webkit.org | 31924df | 2016-10-14 06:31:40 +0000 | [diff] [blame] | 86 | PASS ex.message is "undefined is not an object (evaluating '({b:undefined}).b[0]')" |
| 87 | |
| 88 | Testing '[].a.b.x' |
| 89 | PASS ex.message is "undefined is not an object (evaluating '[].a.b')" |
| 90 | |
| 91 | Testing '[]['a']['b'].x' |
| 92 | PASS ex.message is "undefined is not an object (evaluating '[]['a']['b']')" |
| 93 | |
| 94 | Testing '[].a['b'].x' |
| 95 | PASS ex.message is "undefined is not an object (evaluating '[].a['b']')" |
| 96 | |
| 97 | Testing '[]['a'].b.x' |
| 98 | PASS ex.message is "undefined is not an object (evaluating '[]['a'].b')" |
| 99 | |
| 100 | Testing 'func(undefined.x)' |
| 101 | PASS ex.message is "undefined is not an object (evaluating 'undefined.x')" |
| 102 | |
| 103 | Testing 'func(null.x)' |
| 104 | PASS ex.message is "null is not an object (evaluating 'null.x')" |
| 105 | |
| 106 | Testing 'func(undefined[0])' |
| 107 | PASS ex.message is "undefined is not an object (evaluating 'undefined[0]')" |
| 108 | |
| 109 | Testing 'func(null[0])' |
| 110 | PASS ex.message is "null is not an object (evaluating 'null[0]')" |
oliver@apple.com | 6bfc34a | 2008-07-21 01:37:38 +0000 | [diff] [blame] | 111 | PASS successfullyParsed is true |
| 112 | |
| 113 | TEST COMPLETE |
| 114 | |