7001
|
Error
|
%1
|
A placeholder for any unexpected or unknown
error. %1 can potentially contain any text.
|
7002
|
ReferenceError
|
Error %1 is undefined
|
An unqualified variable lookup failed.
|
7003
|
ReferenceError
|
Cannot assign value
|
An assignment attempts to access a constant
such as a number, string, or XML.
|
7004
|
SyntaxError
|
Unterminated string constant
|
The closing quotation character
(")
was
omitted at the end of a string constant.
Example:
var sName = "Name;
To
correct this error, locate the affected line and add the missing
quotation character
(")
.
|
7005
|
SyntaxError
|
Unterminated comment
|
The closing comment characters
(*/)
were
omitted at the end of a comment string.
Example:
/* The old fashioned comment style is still useful var i = 0;
To
correct this error, locate the affected line and add the missing
closing characters. In this example, add
*/
after
the word
useful
.
Note that when using the
single-line comment characters
(//)
, there is no
need to terminate the comment string with matching closing characters.
|
7006
|
SyntaxError
|
Bad digit in number
|
Contains a character that is not a number
or a valid separator (a period or a space).
Examples:
123u8
123,8
|
7007
|
SyntaxError
|
Language feature %1 is not supported
|
Currently, only property getter and setter
methods are unsupported, as defined in Mozilla SpiderMonkey. Getter
and setter methods are not part of the JavaScript standard. This
error also occurs when compiling JavaScript without XML support
and attempting to use XML.
|
7008
|
SyntaxError
|
Syntax error
|
A generic (catch-all) syntax error.
|
7009
|
SyntaxError
|
Illegal use of reserved word '%1'
|
A keyword was used out of context.
Example:
var for = 56;
The
word
for
is a reserved word and cannot be used
as a variable name.
To correct this error, change the keyword
to a non-reserved word.
|
7010
|
SyntaxError
|
Break or Continue outside a loop
|
The keywords
break
and
continue
are
meant to be used inside a
for
loop or a
while
loop.
The keyword
break
is also valid inside a
switch
statement.
Using these keywords outside these structures is not permitted.
Examples:
Correct:
for (i = 0; i < 20; i++)
{
if (a == i)
break;
}
Incorrect:
var sName = "Nicole";
break;
var sAnimal = "cat";
To correct this error, remove
the line with the
break
statement.
|
7011
|
SyntaxError
|
Label not found
|
JavaScript does not support
goto
,
but it supports labels for
continue
and
break
statements.
Example:
outer: for (I = 0; I < 100; i++)
{
inner: while (condition)
{
if (bad)
break outer;
}
}
To correct this error, ensure that any label
used in a program is defined and that spelling is consistent where
labels are referred to.
|
7013
|
SyntaxError
|
Too many closing braces
|
The program contains an unmatched closing
brace.
Example:
if {sSoftware == "Designer"}
{
// Heh.
sDesc = "Form Design Software";
}}
To correct this error, remove the extra closing
brace.
|
7014
|
SyntaxError
|
No matching closing brace found
|
A closing brace is missing somewhere in
the program.
Example:
The closing brace of the
for
loop
is missing in this program:
if {sSoftware == "Designer"}
{
for {i = 0; i < 7; i++}
{
nCount = nVer + 1;
}
Despite the indentation that indicates the
for
loop
is missing a closing brace, the error line usually indicates that
the
if
statement is missing a brace. Generally,
with a missing brace error, the outermost statement is reported
to be missing the closing brace.
|
7015
|
SyntaxError
|
Try without catch/finally
|
The
try
statement cannot
be used unless it is paired with the
catch/finally
statement.
To
correct this error, remove the
try
statement or
add a
catch/finally
statement.
|
7016
|
SyntaxError
|
Catch/finally without try
|
The
catch
/
finally
statement
cannot be used unless it is paired with the
try
statement.
To
correct this error, remove the
catch/finally
statement
or add a
try
statement.
|
7017
|
TypeError
|
Variable expected
|
A variable name is expected.
Examples:
function f{
1
} {}
try {} catch {"
hi
"} {}
var
5
;
The characters in bold are where a
variable name is expected rather than a constant or a number.
|
7018
|
TypeError
|
Variable or value expected, but found %1
|
Rarely displayed.
The conversion
of an object to a primitive value failed.
Example:
o={toString:function{){return
this}};
o+"test";
|
7019
|
TypeError
|
Bad argument %1
|
A function argument cannot be converted
to a suitable data type. For example, a function is expecting a
number, but a string is passed in instead.
|
7020
|
TypeError
|
Bad argument list
|
There is a problem with the function's argument
list, and the arguments cannot be used.
|
7021
|
TypeError
|
%1 is not an object
|
An invalid object is being used to perform
an operation. An object is needed for an operation, but the data
cannot be converted to an object.
Example:
var obj = null;
obj.toString{};
Calling a method on
obj
fails
because
obj
is null and not an object.
|
7022
|
ReferenceError
|
%1 does not have a constructor
|
Host objects that cannot be created, such
as the Application object, have a dummy constructor function so
that the prototype object can be accessed. An example is Application.prototype
where an attempt was made to use this function as a constructor.
|
7023
|
ReferenceError
|
%1 does not have a value
|
The conversion of an object to a primitive
value failed.
Example:
o={toString:function{}{return
this}};
o+"test";
|
7024
|
ReferenceError
|
%1 is not a function
|
Something is invoked as a function, and
it does not exist.
Example:
var f = "No function";
f{};
|
7025
|
SyntaxError
|
Expected: %1
|
Parser expected a certain symbol but did
not locate it. The missing symbol is often a single character but
can be more than one character.
Example:
<xml>{javascript]</xml> // expected: }
The
parser was expecting the closing symbol
}
after
the word
javascript
to match the opening symbol.
|
7026
|
Error
|
%1 cannot work with this class
|
Methods were moved from one class to another.
Only the
String
and
Array
methods
are generic enough to work with different classes.
Example:
s = new String {'test'};
s.getTime = Date.prototype.getTime;
s.getTime{};
|
7030
|
SyntaxError
|
Illegal 'return' outside a function body
|
Using the keyword
return
outside
a function definition is not permitted.
To correct this error,
remove the
return
statement.
|
7037
|
SyntaxError
|
Conversion error
|
A conversion from one character encoding
to another fails. This is not a JavaScript error. It occurs, for
example, when trying to read a malformed Shift-JIS file.
|
7038
|
SyntaxError
|
Partial multibyte
|
This error occurs during the conversion
from one character encoding to another. This is not a JavaScript
error. It occurs, for example, when the last byte of a UTF-8 file
is missing when the file is read.
|
7039
|
SyntaxError
|
More than one switch default
|
The
switch
statement has
a special label,
default
, which is the code that
runs if no other case in the switch is chosen. Only one
default
label
per
switch
statement is allowed.
Example:
switch {nVersion}
{
case 1:
// ...
break;
case 2:
// ...
break;
default:
// ...
break;
default:
// ...
break;
};
To correct this error, delete all but one
of the
default
labels.
|
7040
|
TypeError
|
%1 redeclared
|
A constant cannot be declared more than
once. A variable can be declared more than once.
Example:
const a = 5;
const a = 6;
|
7041
|
RangeError
|
%1 is out of range
|
An argument, index, or value exceeds the
allowable numeric range.
Example:
Number {5}.toFixed {111}; // 100 is max
|
7042
|
SyntaxError
|
Catch after unconditional catch
|
JavaScript supports multiple catch clauses,
but the last catch clause must be unconditional.
Example:
try {}
catch {e if e instanceof String} {}
catch {e if e > 5} {}
catch {e} {}
catch {e if typeof e == "object"} {}
To correct
this error, move the illegal conditional catch clause before the
unconditional catch clause, or delete it.
|