Skip to content

Commit

Permalink
Improve error message for not defined identifier; update baselines. F…
Browse files Browse the repository at this point in the history
  • Loading branch information
dilijev committed May 2, 2017
1 parent 33abca4 commit e6e01d0
Show file tree
Hide file tree
Showing 41 changed files with 210 additions and 210 deletions.
2 changes: 1 addition & 1 deletion lib/Parser/rterrors.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ RT_ERROR_MSG(JSERR_NeedString, 5005, "'%s' is not a string", "String expected",
RT_ERROR_MSG(JSERR_NeedDate, 5006, "'%s' is not a date object", "Date object expected", kjstTypeError, 0)
RT_ERROR_MSG(JSERR_NeedObject, 5007, "'%s' is null or not an object", "Object expected", kjstTypeError, 0)
RT_ERROR_MSG(JSERR_CantAssignTo, 5008, "", "Invalid left-hand side in assignment", kjstReferenceError, 0)
RT_ERROR_MSG(JSERR_UndefVariable, 5009, "'%s' is undefined", "Undefined identifier", kjstTypeError, 0)
RT_ERROR_MSG(JSERR_UndefVariable, 5009, "'%s' is not defined", "Undefined identifier", kjstTypeError, 0)
RT_ERROR_MSG(JSERR_NeedBoolean, 5010, "'%s' is not a boolean", "Boolean expected", kjstTypeError, 0)

// This is the legacy error code for JScript.
Expand Down
2 changes: 1 addition & 1 deletion test/Basics/IdsWithEscapes.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
10
20
20
ReferenceError: 'hello2' is undefined
ReferenceError: 'hello2' is not defined
SyntaxError: Syntax error
SyntaxError: Syntax error
SyntaxError: Syntax error
Expand Down
2 changes: 1 addition & 1 deletion test/Basics/With.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ null
x.foo
local.i
5
ReferenceError: 'f' is undefined
ReferenceError: 'f' is not defined
abcd
O.evalinwith
local evalinwith
Expand Down
2 changes: 1 addition & 1 deletion test/Bugs/randombug.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ passed
Test case 38
passed
Test case 40
ReferenceError: 'undefinedFunction' is undefined
ReferenceError: 'undefinedFunction' is not defined
at eval code (eval code:1:22)
at testRuntimeError (randombug.js:458:9)
at test31 (randombug.js:462:5)
Expand Down
28 changes: 14 additions & 14 deletions test/Error/CallNonFunction_3.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ TypeError (-2146823281): Object expected
--- Test case: implicit global, do delete: false ---

safeCall(function(){g0();});
ReferenceError (-2146823279): 'g0' is undefined
ReferenceError (-2146823279): 'g0' is not defined

safeCall(function(){g1=undefined;g1();});
TypeError (-2146823281): Object expected
Expand All @@ -40,58 +40,58 @@ TypeError (-2146823286): Function expected
--- Test case: implicit global, do delete: true ---

safeCall(function(){g6=undefined;delete g6;g6();});
ReferenceError (-2146823279): 'g6' is undefined
ReferenceError (-2146823279): 'g6' is not defined

safeCall(function(){g7=null;delete g7;g7();});
ReferenceError (-2146823279): 'g7' is undefined
ReferenceError (-2146823279): 'g7' is not defined

safeCall(function(){g8=1;delete g8;g8();});
ReferenceError (-2146823279): 'g8' is undefined
ReferenceError (-2146823279): 'g8' is not defined

safeCall(function(){g9={};delete g9;g9();});
ReferenceError (-2146823279): 'g9' is undefined
ReferenceError (-2146823279): 'g9' is not defined


--- Test case: global using window, do delete: false ---

Only valid in IE:
safeCall(function(){window.g10();});
ReferenceError (-2146823279): 'window' is undefined
ReferenceError (-2146823279): 'window' is not defined

Only valid in IE:
safeCall(function(){window.g11=undefined;window.g11();});
ReferenceError (-2146823279): 'window' is undefined
ReferenceError (-2146823279): 'window' is not defined

Only valid in IE:
safeCall(function(){window.g12=null;window.g12();});
ReferenceError (-2146823279): 'window' is undefined
ReferenceError (-2146823279): 'window' is not defined

Only valid in IE:
safeCall(function(){window.g13=1;window.g13();});
ReferenceError (-2146823279): 'window' is undefined
ReferenceError (-2146823279): 'window' is not defined

Only valid in IE:
safeCall(function(){window.g14={};window.g14();});
ReferenceError (-2146823279): 'window' is undefined
ReferenceError (-2146823279): 'window' is not defined


--- Test case: global using window, do delete: true ---

Only valid in IE:
safeCall(function(){window.g16=undefined;delete window.g16;window.g16();});
ReferenceError (-2146823279): 'window' is undefined
ReferenceError (-2146823279): 'window' is not defined

Only valid in IE:
safeCall(function(){window.g17=null;delete window.g17;window.g17();});
ReferenceError (-2146823279): 'window' is undefined
ReferenceError (-2146823279): 'window' is not defined

Only valid in IE:
safeCall(function(){window.g18=1;delete window.g18;window.g18();});
ReferenceError (-2146823279): 'window' is undefined
ReferenceError (-2146823279): 'window' is not defined

Only valid in IE:
safeCall(function(){window.g19={};delete window.g19;window.g19();});
ReferenceError (-2146823279): 'window' is undefined
ReferenceError (-2146823279): 'window' is not defined


--- Test case: global using this, do delete: false ---
Expand Down
4 changes: 2 additions & 2 deletions test/Error/ErrorCtorProps_v3.baseline
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ReferenceError: 'RegExpError' is undefined
ReferenceError: 'ConversionError' is undefined
ReferenceError: 'RegExpError' is not defined
ReferenceError: 'ConversionError' is not defined
---------------------------------
toString(): function Error() { [native code] }
Property: 'message'
Expand Down
4 changes: 2 additions & 2 deletions test/Error/NativeErrors_v4.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,6 @@ stack = (string) URIError
toString() = URIError

RegExpError
ReferenceError: 'RegExpError' is undefined
ReferenceError: 'RegExpError' is not defined
ConversionError
ReferenceError: 'ConversionError' is undefined
ReferenceError: 'ConversionError' is not defined
6 changes: 3 additions & 3 deletions test/Error/errorNum.baseline
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
-2146823279 'random' is undefined
-2146823279 'throwException' is undefined
-2146823279 'AString' is undefined
-2146823279 'random' is not defined
-2146823279 'throwException' is not defined
-2146823279 'AString' is not defined
-2146827283 Expected '('
-2146823264 The URI to be encoded contains an invalid character
-2146823263 The URI to be decoded is not a valid encoding
Expand Down
12 changes: 6 additions & 6 deletions test/Error/errorProps_v4.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ RangeError.prototype
number isOwn = false value = undefined
description isOwn = false value = undefined
ConversionError.prototype
ReferenceError: 'ConversionError' is undefined
ReferenceError: 'ConversionError' is not defined

Error
ToString = function Error() { [native code] }
Expand Down Expand Up @@ -97,7 +97,7 @@ new ReferenceError("I'm a reference error")
at Global code (errorprops.js:80:1)
number isOwn = false value = undefined
description isOwn = false value = undefined
ReferenceError: 'RegExpError' is undefined
ReferenceError: 'RegExpError' is not defined

new TypeError()
ToString = TypeError
Expand Down Expand Up @@ -141,11 +141,11 @@ new TypeError("With a undef name")
name isOwn = true value = undefined

Runtime TypeError()
ToString = ReferenceError: 'boo' is undefined
ToString = ReferenceError: 'boo' is not defined
Properties =
name isOwn = false value = ReferenceError
message isOwn = true value = 'boo' is undefined
stack isOwn = true value = ReferenceError: 'boo' is undefined
message isOwn = true value = 'boo' is not defined
stack isOwn = true value = ReferenceError: 'boo' is not defined
at Global code (errorprops.js:111:5)
number isOwn = true value = -2146823279
description isOwn = true value = 'boo' is undefined
description isOwn = true value = 'boo' is not defined
24 changes: 12 additions & 12 deletions test/Error/validate_line_column.baseline
Original file line number Diff line number Diff line change
@@ -1,52 +1,52 @@
ReferenceError: 'z1' is undefined
ReferenceError: 'z1' is not defined
at Anonymous function (validate_line_column.js:17:6)
at foo (validate_line_column.js:10:9)
at Global code (validate_line_column.js:16:1)
ReferenceError: 'z1' is undefined
ReferenceError: 'z1' is not defined
at Anonymous function (validate_line_column.js:21:6)
at foo (validate_line_column.js:10:9)
at Global code (validate_line_column.js:20:1)
TypeError: Function is not a constructor
at Anonymous function (validate_line_column.js:26:24)
at foo (validate_line_column.js:10:9)
at Global code (validate_line_column.js:24:1)
ReferenceError: 'a' is undefined
ReferenceError: 'a' is not defined
at Anonymous function (validate_line_column.js:30:6)
at foo (validate_line_column.js:10:9)
at Global code (validate_line_column.js:29:1)
ReferenceError: 'a' is undefined
ReferenceError: 'a' is not defined
at Anonymous function (validate_line_column.js:35:5)
at foo (validate_line_column.js:10:9)
at Global code (validate_line_column.js:33:1)
ReferenceError: 'a' is undefined
ReferenceError: 'a' is not defined
at Anonymous function (validate_line_column.js:40:5)
at foo (validate_line_column.js:10:9)
at Global code (validate_line_column.js:38:1)
ReferenceError: 'a' is undefined
ReferenceError: 'a' is not defined
at Anonymous function (validate_line_column.js:45:6)
at foo (validate_line_column.js:10:9)
at Global code (validate_line_column.js:43:1)
ReferenceError: 'a' is undefined
ReferenceError: 'a' is not defined
at Anonymous function (validate_line_column.js:50:6)
at foo (validate_line_column.js:10:9)
at Global code (validate_line_column.js:48:1)
ReferenceError: 'a' is undefined
ReferenceError: 'a' is not defined
at Anonymous function (validate_line_column.js:55:6)
at foo (validate_line_column.js:10:9)
at Global code (validate_line_column.js:53:1)
ReferenceError: 'a' is undefined
ReferenceError: 'a' is not defined
at Anonymous function (validate_line_column.js:60:5)
at foo (validate_line_column.js:10:9)
at Global code (validate_line_column.js:58:1)
ReferenceError: 'unresolved' is undefined
ReferenceError: 'unresolved' is not defined
at Anonymous function (validate_line_column.js:65:11)
at foo (validate_line_column.js:10:9)
at Global code (validate_line_column.js:63:1)
ReferenceError: 'unresolved' is undefined
ReferenceError: 'unresolved' is not defined
at Anonymous function (validate_line_column.js:72:11)
at foo (validate_line_column.js:10:9)
at Global code (validate_line_column.js:70:1)
ReferenceError: 'unresolved' is undefined
ReferenceError: 'unresolved' is not defined
at Anonymous function (validate_line_column.js:79:11)
at foo (validate_line_column.js:10:9)
at Global code (validate_line_column.js:77:1)
6 changes: 3 additions & 3 deletions test/Function/defernested.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ call self from with
foo 0

parent is catch scope
ReferenceError: 'no_such_var' is undefined
ReferenceError: 'no_such_var' is not defined
parent func contains catch scope
ReferenceError: 'no_such_var' is undefined
ReferenceError: 'no_such_var' is not defined
parent func contains catch scope and eval
ReferenceError: 'no_such_var' is undefined
ReferenceError: 'no_such_var' is not defined

Win8 540999: arguments identifier used as parameter
TypeError: Unable to get property 'length' of undefined or null reference
Expand Down
Loading

0 comments on commit e6e01d0

Please sign in to comment.