This test exercises the source expression offset information that is attached to exception objects for the inspector.

On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".



Testing 'undefined.a++'
PASS ex.expressionBeginOffset == 0 is true
PASS ex.expressionCaretOffset == 9 is true
PASS ex.expressionEndOffset == 11 is true
PASS ex.message == "Result of expression 'undefined' [undefined] is not an object." is true

Testing '++undefined.a'
PASS ex.expressionBeginOffset == 2 is true
PASS ex.expressionCaretOffset == 11 is true
PASS ex.expressionEndOffset == 13 is true
PASS ex.message == "Result of expression 'undefined' [undefined] is not an object." is true

Testing 'undefined[0]++'
PASS ex.expressionBeginOffset == 0 is true
PASS ex.expressionCaretOffset == 9 is true
PASS ex.expressionEndOffset == 12 is true
PASS ex.message == "Result of expression 'undefined' [undefined] is not an object." is true

Testing '++undefined[1]'
PASS ex.expressionBeginOffset == 2 is true
PASS ex.expressionCaretOffset == 11 is true
PASS ex.expressionEndOffset == 14 is true
PASS ex.message == "Result of expression 'undefined' [undefined] is not an object." is true

Testing 'undefined.b'
PASS ex.expressionBeginOffset == 0 is true
PASS ex.expressionCaretOffset == 9 is true
PASS ex.expressionEndOffset == 11 is true
PASS ex.message == "Result of expression 'undefined' [undefined] is not an object." is true

Testing 'undefined[0]'
PASS ex.expressionBeginOffset == 0 is true
PASS ex.expressionCaretOffset == 9 is true
PASS ex.expressionEndOffset == 12 is true
PASS ex.message == "Result of expression 'undefined' [undefined] is not an object." is true

Testing 'undefined.b += 1'
PASS ex.expressionBeginOffset == 0 is true
PASS ex.expressionCaretOffset == 9 is true
PASS ex.expressionEndOffset == 11 is true
PASS ex.message == "Result of expression 'undefined' [undefined] is not an object." is true

Testing 'undefined[0] += 1'
PASS ex.expressionBeginOffset == 0 is true
PASS ex.expressionCaretOffset == 9 is true
PASS ex.expressionEndOffset == 12 is true
PASS ex.message == "Result of expression 'undefined' [undefined] is not an object." is true

Testing 'undefined()'
PASS ex.expressionBeginOffset == 0 is true
PASS ex.expressionCaretOffset == 9 is true
PASS ex.expressionEndOffset == 11 is true
PASS ex.message == "Result of expression 'undefined' [undefined] is not a function." is true

Testing 'new undefined()'
PASS ex.expressionBeginOffset == 0 is true
PASS ex.expressionCaretOffset == 13 is true
PASS ex.expressionEndOffset == 15 is true
PASS ex.message == "Result of expression 'undefined' [undefined] is not a constructor." is true

Testing '({}).b()'
PASS ex.expressionBeginOffset == 0 is true
PASS ex.expressionCaretOffset == 6 is true
PASS ex.expressionEndOffset == 8 is true
PASS ex.message == "Result of expression '({}).b' [undefined] is not a function." is true

Testing 'new {}.b()'
PASS ex.expressionBeginOffset == 0 is true
PASS ex.expressionCaretOffset == 8 is true
PASS ex.expressionEndOffset == 10 is true
PASS ex.message == "Result of expression '{}.b' [undefined] is not a constructor." is true

Testing '1()'
PASS ex.expressionBeginOffset == 0 is true
PASS ex.expressionCaretOffset == 1 is true
PASS ex.expressionEndOffset == 3 is true
PASS ex.message == "Result of expression '1' [1] is not a function." is true

Testing 'new 1()'
PASS ex.expressionBeginOffset == 0 is true
PASS ex.expressionCaretOffset == 5 is true
PASS ex.expressionEndOffset == 7 is true
PASS ex.message == "Result of expression '1' [1] is not a constructor." is true

Testing 'throw { message : 'thrown object' }'
PASS ex.expressionBeginOffset == 0 is true
PASS ex.expressionCaretOffset == undefined is true
PASS ex.expressionEndOffset == 35 is true
PASS ex.message == "thrown object" is true

Testing '1 in undefined'
PASS ex.expressionBeginOffset == 0 is true
PASS ex.expressionCaretOffset == 5 is true
PASS ex.expressionEndOffset == 14 is true
PASS ex.message == "Result of expression 'undefined' [undefined] is not a valid argument for 'in'." is true

Testing '1 instanceof undefined'
PASS ex.expressionBeginOffset == 0 is true
PASS ex.expressionCaretOffset == 13 is true
PASS ex.expressionEndOffset == 22 is true
PASS ex.message == "Result of expression 'undefined' [undefined] is not a valid argument for 'instanceof'." is true

Testing 'for (undefined.b in [1]) {}'
PASS ex.expressionBeginOffset == 5 is true
PASS ex.expressionCaretOffset == 14 is true
PASS ex.expressionEndOffset == 16 is true
PASS ex.message == "Result of expression 'undefined' [undefined] is not an object." is true

Testing 'for (undefined[0] in [1]) {}'
PASS ex.expressionBeginOffset == 5 is true
PASS ex.expressionCaretOffset == 14 is true
PASS ex.expressionEndOffset == 17 is true
PASS ex.message == "Result of expression 'undefined' [undefined] is not an object." is true

Testing 'undefined.a = 5'
PASS ex.expressionBeginOffset == 0 is true
PASS ex.expressionCaretOffset == 9 is true
PASS ex.expressionEndOffset == 15 is true
PASS ex.message == "Result of expression 'undefined' [undefined] is not an object." is true

Testing 'undefined[0] = 5'
PASS ex.expressionBeginOffset == 0 is true
PASS ex.expressionCaretOffset == 9 is true
PASS ex.expressionEndOffset == 16 is true
PASS ex.message == "Result of expression 'undefined' [undefined] is not an object." is true

Testing '({b:undefined}).b.a = 5'
PASS ex.expressionBeginOffset == 0 is true
PASS ex.expressionCaretOffset == 17 is true
PASS ex.expressionEndOffset == 23 is true
PASS ex.message == "Result of expression '({b:undefined}).b' [undefined] is not an object." is true

Testing '({b:undefined}).b[0] = 5'
PASS ex.expressionBeginOffset == 0 is true
PASS ex.expressionCaretOffset == 17 is true
PASS ex.expressionEndOffset == 24 is true
PASS ex.message == "Result of expression '({b:undefined}).b' [undefined] is not an object." is true

Testing 'undefined.a += 5'
PASS ex.expressionBeginOffset == 0 is true
PASS ex.expressionCaretOffset == 9 is true
PASS ex.expressionEndOffset == 11 is true
PASS ex.message == "Result of expression 'undefined' [undefined] is not an object." is true

Testing 'undefined[0] += 5'
PASS ex.expressionBeginOffset == 0 is true
PASS ex.expressionCaretOffset == 9 is true
PASS ex.expressionEndOffset == 12 is true
PASS ex.message == "Result of expression 'undefined' [undefined] is not an object." is true

Testing '({b:undefined}).b.a += 5'
PASS ex.expressionBeginOffset == 0 is true
PASS ex.expressionCaretOffset == 17 is true
PASS ex.expressionEndOffset == 19 is true
PASS ex.message == "Result of expression '({b:undefined}).b' [undefined] is not an object." is true

Testing '({b:undefined}).b[0] += 5'
PASS ex.expressionBeginOffset == 0 is true
PASS ex.expressionCaretOffset == 17 is true
PASS ex.expressionEndOffset == 20 is true
PASS ex.message == "Result of expression '({b:undefined}).b' [undefined] is not an object." is true
PASS successfullyParsed is true

TEST COMPLETE

