A user account is required in order to edit this wiki, but we've had to disable public user registrations due to spam.
To request an account, ask an autoconfirmed user on Chat (such as one of these permanent autoconfirmed members).
Web ECMAScript
This page is for documenting the differences between the ES5 draft and the requirements for ECMAScript implementations in web browsers.
Identifiers
(this is very rough)
Identifiers containing escape sequences are not equivalent to fully unescaped identifiers in the case that, after fully unescaping identifier, it is a ReservedWord. In particular it is possible to create Identifiers that unescape to a reserved word so long as at least one character is fully escaped. Subsequent use of such identifiers must also have at least one character escaped (otherwise the reserved word will be used instead) but it need not be the same character(s) as that originally used to create the identifier.
15.5.4 Properties of the String Prototype Object
Several extra methods are found on String.prototype for wrapping text in HTML elements (these are all generic; the this value need not be a String object):
Algorithm ToHTMLTag(tag_name, content, attribute_name, attribute_value):
- if attribute_name is undefined return "<" + tag_name + ">" + content + "</" + tag_name + ">"
- otherwise return "<" + tag_name + " " + attribute_name + "=\"" + attribute_value + "\">" + content + "</" + tag_name + ">"
String.prototype.anchor(name)
- Let content be ToString(this)
- Let n be ToString(name)
- Return ToHTMLTag("a", content, "name", n)
String.prototype.big()
- Let content be ToString(this)
- Return ToHTMLTag("big", content)
String.prototype.blink()
- Let content be ToString(this)
- Return ToHTMLTag("blink", content)
String.prototype.bold()
- Let content be ToString(this)
- Return ToHTMLTag("b", content)
String.prototype.fixed()
- Let content be ToString(this)
- Return ToHTMLTag("tt", content)
String.prototype.fontcolor(color)
- Let content be ToString(this)
- Let attribute_value be ToString(color)
- Return ToHTMLTag("font", content, "color", attribute_value)
String.prototype.fontsize(size)
- Let content be ToString(this)
- Let attribute_value be ToString(size)
- Return ToHTMLTag("font", content, "size", attribute_value)
String.prototype.italics()
- Let content be ToString(this)
- Return ToHTMLTag("i", content)
String.prototype.link(href)
- Let content be ToString(this)
- Let attribute_value be ToString(href)
- Return ToHTMLTag("a", content, "href", attribute_value)
String.prototype.small()
- Let content be ToString(this)
- Return ToHTMLTag("small", content)
String.prototype.strike()
- Let content be ToString(this)
- Return ToHTMLTag("strike", content)
String.prototype.sub()
- Let content be ToString(this)
- Return ToHTMLTag("sub", content)
String.prototype.sup()
- Let content be ToString(this)
- Return ToHTMLTag("sup", content)
Global scope
ES3.1 claims the global scope "this" is the same as the global object, which is not always true in HTML5.
Eval
Use of eval not called "eval". Shoud work but implementations differ on the scope (Spidermonkey first tries global and then local if the object as not found globally, JScript uses local scope, others use global scope), may not have strong compat requirements
eval.apply(this, code) should work but scope again varies when "this" is not the global object
eval.apply({}, code) should throw EvalError
Date Parsing
TODO:This is a mess
HTML comments
<!-- is a line comment (same as //)
In JScript, the following are ignored if they are at the end of the script (i.e. just followed by whitespace lines): either (1) a line that starts with just whitespace and comments and consists of "-->" followed by anything except new lines and finally followed by another "-->", or (2) one or two lines that start with just whitespace and comments and consist of just "-->". Moreover, a script can end with an open multiline comment if it ends with "-->" on the same line.
In Futhark, the following is ignored if it is at the end of the script (i.e. just followed by whitespace lines): a line that starts with just whitespace and comments and consists of "-->", and optionally followed by anything except new lines and finally followed by another "-->". Moreover, a script can end with an open multiline comment if it ends with "-->" on the same line.
In SpiderMonkey, "-->" on any line that starts with just whitespace and comments is treated as a line comment (same as //).
In Nitro and V8, "-->" on any line that starts with just whitespace (but not comments) is treated as a line comment (same as //).
Stuff that needs a home
Enumeration of objects is in insertion order (but host property order compared to user defined property order does not seem to be significant)