JSON invalid label
View Single Post
11-07-2007, 01:36 AM
La Vida es Sueño
Join Date: Sep 2007
Although some browser error messages seem obscure they often actually
provide a better clue to what is happening that it may at first appear.
In this case "invalid label" is a better clue than it appears as in
(expected to correspond with the start of a loop construct of some sort)
and consists of an Identifier followed by a colon. If an object literal
was interpreted in a context where what was intended to be a property
name in the form of a string literal was interpreted as a label (because
of the following colon) then it would be invalid and "invalid label"
would be a very direct and informative error message.
The problem here is likely that a string containing this apparent object
literal definition is begin passed directly to the - eval - function and
object literal definition in the wrong context can be interpreted as a
the contained name value pairs then look like labelled expression
statements. Under this interpretation most object literals would include
syntax errors and so fail to execute but some can happily (if
pointlessly) be executed as a javascirpt Program
The man who comes back through the Door in the Wall will never be quite the same as the man who went out.
View Public Profile
Send a private message to Wildhoney
Visit Wildhoney's homepage!
Find More Posts by Wildhoney