File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes HTML, CSS and JavaScript and the fly likes missing name after . operator ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "missing name after . operator ?" Watch "missing name after . operator ?" New topic

missing name after . operator ?

Luke Murphy
Ranch Hand

Joined: May 12, 2010
Posts: 300
This is from the book 'Javascript the good parts'.

I have replaced the document.writeln() with print() so that I can run it in eclipse with rhino.

When I try to run it, I get:

js: line 24: missing name after . operator
js: myObject.double = function () {
js: ...............^
js: line 32: syntax error
js: };
js: ^
js: line 34: missing name after . operator
js: myObject.double();
js: ...............^

Any ideas?
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63873

double is a JavaScript reserved word and cannot be used as a property name using the dot notation.

[Asking smart questions] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: missing name after . operator ?
It's not a secret anymore!