Updated FAQ (2010-04-01)

G

Garrett Smith

"What is a host object"
This entry replaces "What are Object Models?"
Contributors: Michaux, Bozhilov, Lahn, Cornford, Stockton

Resources section: ECMAScript resources
Slothful writing fixed
Contributors: Stockton

Resources section: Safari Documentation
Fixed links
Contributors: RobG

In the thread for "What are object models?", I suggested adding
sectional text to the top of the Objects section. Nobody commented on
that and the text was not added. One more time, the proposed text is:

| ECMA-262 r3 defines the the Global object, Object, Function, Array,
| String, Boolean, Number, Math, Date, RegExp, and Error objects: Error,
| EvalError, RangeError, ReferenceError, SyntaxError, TypeError and
| URIError.

And right after that:

| "What is a host object?"

The idea was to explain what ECMA provides and contrast the entry on
host objects.

I have also updated the links from faq_notes to point to the new notes.

The new notes have navigation and fixed typos.

The index page of the new notes does not contain the link to the
contributors page and browser detection pages because they are not done.
I also added a link to Juriy's excellent "named function expressions"
article.

Thanks, guys. Keep the suggestions coming.
 
D

Dr J R Stockton

In comp.lang.javascript message <[email protected]
september.org>, Fri, 2 Apr 2010 23:19:33, Garrett Smith
Slothful writing fixed
| ECMA-262 r3 defines the the Global object,

Careless writing. It is ECMA 262 Edition 3 (or 3rd Edition). And a
good spelling &c. checker (& MS Word) will report the other error in the
line.
 
G

Garrett Smith

Dr said:
In comp.lang.javascript message <[email protected]
september.org>, Fri, 2 Apr 2010 23:19:33, Garrett Smith



Careless writing. It is ECMA 262 Edition 3 (or 3rd Edition). And a
good spelling &c. checker (& MS Word) will report the other error in the
line.

I see a double of the word "the". What "&c"?

Once more, properly formatted:
| ECMA-262 edition 3 defines the Global object and the built-in objects
| Object, Function, Array, String, Boolean, Number, Math, Date, RegExp,
| and the seven Error objects: Error, EvalError, RangeError,
| ReferenceError, SyntaxError, TypeError and URIError.
 
D

Dr J R Stockton

In comp.lang.javascript message <[email protected]
september.org>, Sun, 4 Apr 2010 16:35:10, Garrett Smith
I see a double of the word "the". What "&c"?

The word "the" is, both times, spelt correctly.
A spelling checker, as such, will not find the duplication.
Therefore, to find the duplication, one needs something that checks
things other than spelling. That is what "&c" represents.

Yesterday, I used MiniTrue to scan source of my site for "the the", and
today for RegExp ([a-z]+)\s+\1 which found a "not not". For regular
use, a little refinement is needed to reduce the number of false
positives found in, for example, script sections. St Luke, /loc cit/.
Once more, properly formatted:
| ECMA-262 edition 3 defines the Global object and the built-in objects
| Object, Function, Array, String, Boolean, Number, Math, Date, RegExp,
| and the seven Error objects: Error, EvalError, RangeError,
| ReferenceError, SyntaxError, TypeError and URIError.

Does it really define Objects Object ... RegExp [... URIError] ? I
think it actually defines those Object types, without defining any
instances of those Objects. Defining actual Objects is done by
executing code.
 
G

Garrett Smith

Dr said:
In comp.lang.javascript message <[email protected]
september.org>, Sun, 4 Apr 2010 16:35:10, Garrett Smith
[...]
Once more, properly formatted:
| ECMA-262 edition 3 defines the Global object and the built-in objects
| Object, Function, Array, String, Boolean, Number, Math, Date, RegExp,
| and the seven Error objects: Error, EvalError, RangeError,
| ReferenceError, SyntaxError, TypeError and URIError.

Does it really define Objects Object ... RegExp [... URIError] ? I
think it actually defines those Object types, without defining any
instances of those Objects. Defining actual Objects is done by
executing code.
I'm afraid your missing the obvious: The `Object` constructor is a
built-in object.

Does anyone else find what is written confusing?
 
J

John G Harris

I'm afraid your missing the obvious: The `Object` constructor is a
built-in object.

Does anyone else find what is written confusing?

Yes, in that I needed to read it twice. Try writing it as :

ECMA-262 3rd edition defines the Global and Math objects, the
constructors Object, Function, Array, String, Boolean, Number, Date, and
RegExp, and the Error object constructors Error, EvalError, RangeError,
ReferenceError, SyntaxError, TypeError and URIError.

John
 
G

Garrett Smith

John said:
Yes, in that I needed to read it twice. Try writing it as :

ECMA-262 3rd edition defines the Global and Math objects, the
constructors Object, Function, Array, String, Boolean, Number, Date, and
RegExp, and the Error object constructors Error, EvalError, RangeError,
ReferenceError, SyntaxError, TypeError and URIError.
Alright.

As written, the Math object sticks out like the sore thumb it is. The
global object is special; the other objects are constructors; the Math
object a collection of methods that work with numbers, yet Number does
not have many methods.
 
A

Antony Scriven

n said:
Yes, in that I needed to read it twice. Try writing it as :

ECMA-262 3rd edition defines the Global and Math objects,
the constructors Object, Function, Array, String,
Boolean, Number, Date, and RegExp, and the Error object
constructors Error, EvalError, RangeError,
ReferenceError, SyntaxError, TypeError and URIError.

Better, but the punctuation makes the meaning ambiguous.
Try this.

ECMA-262 3rd Edition defines the Global and Math objects.
It also defines these constructors: Object, Function,
Array, String, Boolean, Number, Date, and RegExp. And it
defines these Error object constructors: Error,
EvalError, RangeError, ReferenceError, SyntaxError,
TypeError and URIError.

A formatted list might make this clearer as mentioned
elsewhere. --Antony
 
G

Garrett Smith

Antony said:
Better, but the punctuation makes the meaning ambiguous.
Try this.

What is ambiguous about that?
ECMA-262 3rd Edition defines the Global and Math objects.
It also defines these constructors: Object, Function,
Array, String, Boolean, Number, Date, and RegExp. And it
defines these Error object constructors: Error,
EvalError, RangeError, ReferenceError, SyntaxError,
TypeError and URIError.

Stockton would probably get mad about that. The sentence beginning with
"And" is grammatically incorrect.
A formatted list might make this clearer as mentioned
elsewhere. --Antony
I don't feel so strongly on that.
 
B

Bwig Zomberi

Garrett said:
Stockton would probably get mad about that. The sentence beginning with
"And" is grammatically incorrect.
Use a comma after "and" and complete the series with what you could not
include in the previous sentence. You can use this punctuation with
other conjunctions such as "so" and "but".


I don't feel so strongly on that.

You could try logical grouping like this:

ECMA-262 3rd edition defines

i. the Global and Math objects
ii. the constructors - Object, Function, Array, String, Boolean,
Number, Date, and RegExp
iii. the Error object constructors - Error, EvalError, RangeError,
ReferenceError, SyntaxError, TypeError and URIError

Or use semicolons as Americans would.
 
A

Asen Bozhilov

Garrett said:
| ECMA-262 r3 defines the the Global object, Object, Function, Array,
| String, Boolean, Number, Math, Date, RegExp, and Error objects: Error,
| EvalError, RangeError, ReferenceError, SyntaxError, TypeError and
| URIError.

And right after that:

| "What is a host object?"

The idea was to explain what ECMA provides and contrast the entry on
host objects.

That list contain standard built-in objects. These objects are native
by definition of built-in objects. With that list you cannot explain
the differences between host and native objects. I think FAQ must have
entry about:

"What is a native object?"
Native object is member of type Object. It's unordered collection
of properties each of which contains a value. ECMA-262 describe
internal behaviour of native objects in definition
of The Object Type.

Followed by:

"What is a built-in object?"

and finally:

"What is a host object?"
 
J

Jorge

Yes, in that I needed to read it twice. Try writing it as :

ECMA-262 3rd edition defines the Global and Math objects, the
constructors Object, Function, Array, String, Boolean, Number, Date, and
RegExp, and the Error object constructors Error, EvalError, RangeError,
ReferenceError, SyntaxError, TypeError and URIError.

And the global functions decodeURI and encodeURI and
decodeURIComponent and encodeURIComponent and eval and isFinite and
isNaN and parseFloat and parseInt.
 
B

Bwig Zomberi

Antony said:
Garrett said:
ECMA-262 3rd Edition defines the Global and Math objects.
It also defines these constructors: Object, Function,
Array, String, Boolean, Number, Date, and RegExp. And it
defines these Error object constructors: Error,
EvalError, RangeError, ReferenceError, SyntaxError,
TypeError and URIError.
[...] The sentence beginning with "And" is
grammatically incorrect.

It isn't.
Use a comma after "and" [...]

That's not necessary, but you may if you wish.

A comma is used to indicate a pause or for the sake of clarity.
[...]

Or use semicolons as Americans would.

Americans use them differently? --Antony

Americans style guides suggest the use of semicolons like this:

ECMA-262 3rd edition defines the Global and Math objects; the
constructors Object, Function, Array, String,
Boolean, Number, Date, and RegExp; and the Error object
constructors Error, EvalError, RangeError,
ReferenceError, SyntaxError, TypeError and URIError.

It looks awkward but it is functional. If it wasn't a case of American
ingenuity, then a round of applause for the British.
 
A

Antony Scriven

Antony said:
On Apr 9, 11:05 am, Bwig Zomberi wrote:
Garrett Smith wrote:
ECMA-262 3rd Edition defines the Global and Math
objects. It also defines these constructors:
Object, Function, Array, String, Boolean, Number,
Date, and RegExp. And it defines these Error
object constructors: Error, EvalError,
RangeError, ReferenceError, SyntaxError,
TypeError and URIError.
[...] The sentence beginning with "And" is
grammatically incorrect.
It isn't.
Use a comma after "and" [...]
That's not necessary, but you may if you wish.

A comma is used to indicate a pause or for the sake of
clarity.

Of course.
[...]
Or use semicolons as Americans would.
Americans use them differently? --Antony

Americans style guides suggest the use of semicolons like
this:

ECMA-262 3rd edition defines the Global and Math objects;
the constructors Object, Function, Array, String,
Boolean, Number, Date, and RegExp; and the Error object
constructors Error, EvalError, RangeError,
ReferenceError, SyntaxError, TypeError and URIError.

Then `no' to answer my own question. :)
It looks awkward but it is functional. If it wasn't
a case of American ingenuity, then a round of applause
for the British.

I used the colons for a reason. What you've written is still
hard to parse. It could be read as:

* the constructors Object,
* Function,
* Array,
...
* and the Error object constructors Error,
* EvalError
...

The first one is the worst offender. Obviously -- to our
eyes at least -- that's not the intent, but it's not as easy
to read as it could be either. While there is no need to shy
away from long sentences if they are formulated properly,
there is no need to cram three lists into one sentence
either, and certainly not in a technical document where the
ability to impart understanding trumps writing stylishly
(though I think they often go hand-in-hand). --Antony
 
J

Jorge

"What is a host object"
   This entry replaces "What are Object Models?"
   Contributors: Michaux, Bozhilov, Lahn, Cornford, Stockton

Resources section: ECMAScript resources
   Slothful writing fixed
   Contributors: Stockton

Resources section: Safari Documentation
   Fixed links
   Contributors: RobG

In the thread for "What are object models?", I suggested adding
sectional text to the top of the Objects section. Nobody commented on
that and the text was not added. One more time, the proposed text is:

| ECMA-262 r3 defines the the Global object, Object, Function, Array,
| String, Boolean, Number, Math, Date, RegExp, and Error objects: Error,
| EvalError, RangeError, ReferenceError, SyntaxError, TypeError and
| URIError.

The reality is that it provides a Global object, and what you list
above are properties of it. But then you could (should ?) as well list
its methods, that are global functions : decodeURI and encodeURI and
decodeURIComponent and encodeURIComponent and eval and isFinite and
isNaN and parseFloat and parseInt. And other Global properties that
are neither objects nor methods, such as Infinity, NaN, and undefined.

Because the number of built-in objects and methods and values provided
is much larger, for example Object.prototype is also a provided
object, only that they aren't globals.

Also, it would be a good idea to mention the new global JSON object,
and the new global methods escape and unescape, even though they're
not in the 3rd edition, because they're already implemented in most
current browsers.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top