Reformatted leading whitespace to conform with the implied format.
This commit is contained in:
parent
86816b8b3e
commit
98b1de9199
@ -96,62 +96,61 @@ snippet cl
|
|||||||
console.log(${1});
|
console.log(${1});
|
||||||
# return
|
# return
|
||||||
snippet ret
|
snippet ret
|
||||||
return ${1:result}
|
return ${1:result}
|
||||||
# for (property in object ) { ... }
|
# for (property in object ) { ... }
|
||||||
snippet fori
|
snippet fori
|
||||||
for (var ${1:prop} in ${2:Things}) {
|
for (var ${1:prop} in ${2:Things}) {
|
||||||
${3:$2[$1]}
|
${3:$2[$1]}
|
||||||
};
|
};
|
||||||
# hasOwnProperty
|
# hasOwnProperty
|
||||||
snippet has
|
snippet has
|
||||||
hasOwnProperty(${1})
|
hasOwnProperty(${1})
|
||||||
# docstring
|
# docstring
|
||||||
snippet /**
|
snippet /**
|
||||||
/**
|
/**
|
||||||
* ${1:description}
|
* ${1:description}
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
snippet @par
|
snippet @par
|
||||||
@param {${1:type}} ${2:name} ${3:description}
|
@param {${1:type}} ${2:name} ${3:description}
|
||||||
snippet @ret
|
snippet @ret
|
||||||
@return {${1:type}} ${2:description}
|
@return {${1:type}} ${2:description}
|
||||||
|
|
||||||
# JSON.parse
|
# JSON.parse
|
||||||
snippet jsonp
|
snippet jsonp
|
||||||
JSON.parse(${1:jstr});
|
JSON.parse(${1:jstr});
|
||||||
# JSON.stringify
|
# JSON.stringify
|
||||||
snippet jsons
|
snippet jsons
|
||||||
JSON.stringify(${1:object});
|
JSON.stringify(${1:object});
|
||||||
# self-defining function
|
# self-defining function
|
||||||
snippet sdf
|
snippet sdf
|
||||||
var ${1:function_name} = function (${2:argument}) {
|
var ${1:function_name} = function (${2:argument}) {
|
||||||
${3:// initial code ...}
|
${3:// initial code ...}
|
||||||
|
|
||||||
$1 = function ($2) {
|
$1 = function ($2) {
|
||||||
${4:// main code}
|
${4:// main code}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
# singleton
|
# singleton
|
||||||
snippet sing
|
snippet sing
|
||||||
function ${1:Singleton} (${2:argument}) {
|
function ${1:Singleton} (${2:argument}) {
|
||||||
// the cached instance
|
// the cached instance
|
||||||
var instance;
|
var instance;
|
||||||
|
|
||||||
// rewrite the constructor
|
// rewrite the constructor
|
||||||
$1 = function $1($2) {
|
$1 = function $1($2) {
|
||||||
return instance;
|
return instance;
|
||||||
};
|
};
|
||||||
|
|
||||||
// carry over the prototype properties
|
// carry over the prototype properties
|
||||||
$1.prototype = this;
|
$1.prototype = this;
|
||||||
|
|
||||||
// the instance
|
// the instance
|
||||||
instance = new $1();
|
instance = new $1();
|
||||||
|
|
||||||
// reset the constructor pointer
|
// reset the constructor pointer
|
||||||
instance.constructor = $1;
|
instance.constructor = $1;
|
||||||
|
|
||||||
${3:// code ...}
|
${3:// code ...}
|
||||||
|
|
||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user