Saturday, February 11, 2012

Re: javascript.vim syntax file

On Feb 10, 6:36 am, esquifit <esqui...@googlemail.com> wrote:

> "getElementById" and "childNodes" are not part of the javascript language,
> that's why they are not highlighted.
> These are methods of native objects of the host environment in which
> javascript runs, which is usually a web browser but it needs not.
>
> The javascript specs (more properly the ECMAScript specification)
> distinguishes among native, built-in and host objects.  The DOM Objects
> (for example the window object) in a browser environment is an example of
> host object; they don't belong to the language itself. Consequently they
> and their methods are not highlighted by a pure javascript syntax file.
>
> Regarding 'slice', there is a javascript method of the native Array object
> called slice. I'd expect it to be highlighted. It is however possible for
> host objects to have methods also called this way, or that the javascript
> syntax file cannot decide whether a particular variable represents a
> native, a user-defined or a host object and for this reason the word is not
> highlighted.

Okay. Useful info. I'm getting started with javascript and didn't know
that. Thanks.

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: