Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSLint test #34

Closed
wants to merge 16 commits into from
Closed

JSLint test #34

wants to merge 16 commits into from

Conversation

philipvr
Copy link
Contributor

You can now run JSLint via command line:

$ cd test/jslint/
$ source jslint ../js/hotdrink.js
=== ../js/hotdrink.js ===
ERRORS:
 6:3    Missing 'use strict' statement.
    var error = function (message) {
 ---
 7:26   Expected '{' and instead saw 'return'.
    if (!window.console) return;
 ---
 11:3   Unexpected 'var'.
    var warning = function (message) {
 ---
 11:3   Stopping.  (0% scanned).
===

@thejohnfreeman
Copy link
Member

Don't put JSLint into the repository. Just assume the user has it installed, and add the appropriate commands to the Makefile so that it is run on every build.

Once that is done, the branch can start work on fixing all the errors.

Philip Van Ruitenbeek and others added 5 commits June 22, 2012 16:36
The jslint errors are as follows:
=== hotdrink.js ===
ERRORS:
 341:96 Line too long.
 raid.error("lib/utility/publisher.js:6: " + "new publisher already has property: " + f);
 ---
 363:15 Unexpected 'in'. Compare with undefined, or use the hasOwnProperty method instead.
 if (!(evt in subscribers)) {
 ---
 382:15 Unexpected 'in'. Compare with undefined, or use the hasOwnProperty method instead.
 if (!(evt in this.subscribers)) {
 ---
 581:3  Unexpected 'hd'.
 hd.__private.Variable   = Variable;
 ---
 581:3  Stopping.  (14% scanned).
===
@philipvr
Copy link
Contributor Author

Even after adding /*global hd:true */, jslint still gives the error:

Unexpected 'hd'.
hd.__private.Variable   = Variable;

@thejohnfreeman
Copy link
Member

A semicolon is missing from the preceding statement.

Philip Van Ruitenbeek added 4 commits July 2, 2012 11:44
using [node](github.com/joyent/node) and [node-jslint](github.com/philipvr/node-jslint)
@philipvr
Copy link
Contributor Author

philipvr commented Jul 3, 2012

I have fixed most of the jslint errors, but main thing that jslint still has a problem with is the use of 'in':

lib/bindings/behavior/value.js error(s)
================================
30   Unexpected 'in'. Compare with undefined, or use the hasOwnProperty method instead.
:19  if ("value" in maybe) {
---

@thejohnfreeman
Copy link
Member

Could you follow the suggestion and convert them all to use hasOwnProperty please?

Philip Van Ruitenbeek added 4 commits July 3, 2012 16:24
Conflicts:
	lib/model/runtime/runtime.js
	lib/model/solver/solver.js
	lib/utility/publisher.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants