... Not true. typeof remains broken. An Array.isArray method is added. ... Not exactly. this will be bound to undefined, which might result in throwing. ... ...
1382
Cheney, Edward A SSG ...
sandyhead25
Jul 21, 2010 4:49 pm
That is perfectly valid and acceptable. for (var i=0, j=9; i <= 9; i++, j--) document.writeln("a["+i+"]["+j+"]= " + a[i][j]); It is a standard for loop with...
1383
Mark Volkmann
mark_volkmann
Jul 22, 2010 1:00 am
Even though it's not supported yet, I'd still like to understand something about how this is supposed to work. I understand I can include "use strict"; in a...
1384
pauanyu
Jul 22, 2010 3:58 am
Really! I heard talk about typeof being fixed. I guess they figured it would cause too many compatibility problems so they cut it? I also recall hearing about...
1385
Douglas Crockford
douglascrock...
Jul 22, 2010 12:23 pm
... It affects the whole file, and only the file. Strict functions can interact with sloppy functions....
1386
Bert Belder
bertbelder
Jul 27, 2010 9:52 pm
When linting this code: (function outer() { var foo = function() { bar(); }; var bar = function() { }; foo(); })(); JSLint gives me these warnings: Problem at...
1387
Mark Volkmann
mark_volkmann
Jul 28, 2010 12:03 am
JSLint wants you to define functions before their first call is encountered. While your code would work the way you haven't, it's considered better style to...
1388
bertbelder
Jul 28, 2010 12:53 am
Allright. But what if I have two functions that mutually call each other (that was when I ran into this)? Then there is always one that is 'encountered39; before...
1389
Marcel Duran
marcelduran
Jul 28, 2010 1:03 am
You could use: var foo, bar; foo = function () { bar(); }; bar = function () { foo(); }; Marcel ... -- Marcel Duran [Non-text portions of this message have...
1390
Cheney, Edward A SSG ...
sandyhead25
Jul 28, 2010 3:40 am
These suggestions are all wrong. The problem here is when a variable invoked and defined. You can use: function foo () { bar(); } function bar () { var a =...
1391
Dominic Mitchell
happygiraffe...
Jul 28, 2010 7:01 am
Hi all! I've released an update to my jslint wrapper, jslint4java. The main change is that it can now produce JUnit XML output, enabling better integration...
1392
Mark Volkmann
mark_volkmann
Jul 28, 2010 11:21 am
Edward, Starting your reply with "These suggestions are all wrong." is rude, especially when they are not. Here is the original code, modified so JSLint likes...
1393
bertbelder
Jul 28, 2010 12:49 pm
I know that reversing the declaration order would fix the example code I posted. However the situation that caused to me run into this doesn't really allow...
1394
Michael
newmaniese
Jul 28, 2010 1:02 pm
... Bert; You're making a bunch of assumptions about your code. In the future you might try to make some changes that will make your code wrong. Imagine in ...
1395
bertbelder
Jul 28, 2010 1:07 pm
... Erm, I don't see it. What becomes global then?...
1396
Michael
newmaniese
Jul 28, 2010 1:22 pm
... beyond confusing if you have it also defined in the global scope. [Non-text portions of this message have been removed]...
1397
Mark Volkmann
mark_volkmann
Jul 29, 2010 8:34 pm
I'm a little confused about something that is pretty fundamental in JavaScript. I was thinking that Object is a prototype of every object. That doesn't seem to...
1398
Douglas Crockford
douglascrock...
Jul 29, 2010 8:50 pm
... {} inherits from Object.prototype. Object inherits from Function.prototype because it is a function. A string inherits from String.prototype, which...
1399
Mark Volkmann
mark_volkmann
Jul 30, 2010 1:38 pm
On Thu, Jul 29, 2010 at 3:50 PM, Douglas Crockford ... Thank you very much! That helped a lot! Can someone explain why the second line below outputs false? I...
1400
Douglas Crockford
douglascrock...
Jul 30, 2010 8:49 pm
... prototype is a property of a constructor function, it is not the property through which an object delegates to another object, which is the key to...
1401
Leonardo
sombriks_1
Jul 30, 2010 10:48 pm
2010/7/30 Douglas Crockford <douglas@...> (...) ... (...) Why not Doug? also, in order do emulate classes i've been using closures like this: ...
I grabbed a copy of arrayextras.js from http://erik.eae.net/archives/2005/06/05/17.53.19/ so I could use the new ECMAScript 5 Array methods in ECMAScript 3...
1404
Mark Volkmann
mark_volkmann
Aug 1, 2010 5:13 pm
... Thanks for explaining that! I think I've almost connected all the dots. function Foo() {} var foo = new Foo(); All of these line print "true" in Rhino: ...
1405
pauanyu
Aug 2, 2010 10:33 am
... I dunno about Rhino, but in Chrome, Function.constructor.prototype is actually a function, that is constructed by Function. Try this: ...
1406
Mark Volkmann
mark_volkmann
Aug 2, 2010 4:30 pm
Just learned something new! This works in Rhino 1.7. See the line with the comment below. function assert(condition) { if (!condition) print('assertion...
1407
Douglas Crockford
douglascrock...
Aug 2, 2010 4:56 pm
... No, which is why you should avoid it....
1408
tsmithnode
Aug 3, 2010 1:20 am
I put a small shim in the JSLint Rhino edition to make it run identically on node.js: http://github.com/tsmith/jslint-node-edition With this you can run JSLint...
1409
abyssoft@...
abyssoft...
Aug 6, 2010 6:19 am
As Described in ECMA-262 3rd Edition JSLint fails to support Rules for Variable names as laid out in section 7.3 on page 14-15 where... Identifier :: ...
1410
Harry Whitfield
harry152566
Aug 8, 2010 6:36 pm
var x = "fred"; if (x == " ") { // the string is a single space, not the empty string alert("x is a space"); } results in this error message: Error: Problem at...