This commit is contained in:
j 2012-07-05 19:45:41 +02:00
commit 4b71d7c03b

View file

@ -2,78 +2,6 @@
'use strict';
/*
Some conventions:
Functions
- only one var statement, in the first line of the function
- return only once, from the last line of the function
Variable names
arg argument
args arguments
array array
canFoo boolean
callback callback function
collection collection (array, string or object)
date date
iterator iterator function
hasFoo boolean
i index (integer key)
index index (integer key)
isFoo boolean
k key (of a key/value pair)
key key (of a key/value pair)
max maximum value
min minimum value
number number
object object
regexp regexp
ret return value
string string
test test function
v value (of a key/value pair)
value value (of a key/value pair)
Indentation
Variable definitions
var a = {
key: value,
key: value,
key: value
},
b = {key: value},
c = {key: value};
Method chaining
Obj.fnA({
key: value,
key: value,
key: value
})
.fnB({key: val})
.fnC({key: val});
Simple conditionals
condition && expression;
Conditionals
if (condition) {
expression;
}
Conditionals with long conditions
if (
condition
&& condition
&& condition
) {
expression;
}
Ternary operator
condition ? expression : expression;
Ternary operator with long conditions or expressions
condition ? expression
: condition ? expression
: expression;
*/
// todo: check http://ejohn.org/blog/ecmascript-5-strict-mode-json-and-more/
// also see https://github.com/tlrobinson/narwhal/blob/master/lib/util.js
/*@
Ox <f> The `Ox` object
See `Ox.wrap` for details.