Return-Path: X-Original-To: apmail-incubator-callback-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-callback-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 487039FD7 for ; Wed, 13 Jun 2012 17:09:09 +0000 (UTC) Received: (qmail 48348 invoked by uid 500); 13 Jun 2012 17:09:09 -0000 Delivered-To: apmail-incubator-callback-commits-archive@incubator.apache.org Received: (qmail 48230 invoked by uid 500); 13 Jun 2012 17:09:09 -0000 Mailing-List: contact callback-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: callback-dev@incubator.apache.org Delivered-To: mailing list callback-commits@incubator.apache.org Received: (qmail 48095 invoked by uid 99); 13 Jun 2012 17:09:08 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 13 Jun 2012 17:09:08 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 29CFE110A1; Wed, 13 Jun 2012 17:09:08 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: filmaj@apache.org To: callback-commits@incubator.apache.org X-Mailer: ASF-Git Admin Mailer Subject: [5/19] removed node modules from version control, whoops Message-Id: <20120613170908.29CFE110A1@tyr.zones.apache.org> Date: Wed, 13 Jun 2012 17:09:08 +0000 (UTC) http://git-wip-us.apache.org/repos/asf/incubator-cordova-blackberry-webworks/blob/2329a568/bin/node_modules/coffee-script/lib/repl.js ---------------------------------------------------------------------- diff --git a/bin/node_modules/coffee-script/lib/repl.js b/bin/node_modules/coffee-script/lib/repl.js deleted file mode 100644 index 9e1bf7c..0000000 --- a/bin/node_modules/coffee-script/lib/repl.js +++ /dev/null @@ -1,123 +0,0 @@ -(function() { - var ACCESSOR, CoffeeScript, Module, REPL_PROMPT, REPL_PROMPT_CONTINUATION, SIMPLEVAR, Script, autocomplete, backlog, completeAttribute, completeVariable, enableColours, error, g, getCompletions, inspect, nonContextGlobals, readline, repl, run, sandbox, stdin, stdout, _i, _len; - CoffeeScript = require('./coffee-script'); - readline = require('readline'); - inspect = require('util').inspect; - Script = require('vm').Script; - Module = require('module'); - REPL_PROMPT = 'coffee> '; - REPL_PROMPT_CONTINUATION = '......> '; - enableColours = false; - if (process.platform !== 'win32') { - enableColours = !process.env.NODE_DISABLE_COLORS; - } - stdin = process.openStdin(); - stdout = process.stdout; - error = function(err) { - return stdout.write((err.stack || err.toString()) + '\n\n'); - }; - backlog = ''; - sandbox = Script.createContext(); - nonContextGlobals = ['Buffer', 'console', 'process', 'setInterval', 'clearInterval', 'setTimeout', 'clearTimeout']; - for (_i = 0, _len = nonContextGlobals.length; _i < _len; _i++) { - g = nonContextGlobals[_i]; - sandbox[g] = global[g]; - } - sandbox.global = sandbox.root = sandbox.GLOBAL = sandbox; - run = function(buffer) { - var code, returnValue, _; - if (!buffer.toString().trim() && !backlog) { - repl.prompt(); - return; - } - code = backlog += buffer; - if (code[code.length - 1] === '\\') { - backlog = "" + backlog.slice(0, -1) + "\n"; - repl.setPrompt(REPL_PROMPT_CONTINUATION); - repl.prompt(); - return; - } - repl.setPrompt(REPL_PROMPT); - backlog = ''; - try { - _ = sandbox._; - returnValue = CoffeeScript.eval("_=(" + code + "\n)", { - sandbox: sandbox, - filename: 'repl', - modulename: 'repl' - }); - if (returnValue === void 0) { - sandbox._ = _; - } else { - process.stdout.write(inspect(returnValue, false, 2, enableColours) + '\n'); - } - } catch (err) { - error(err); - } - return repl.prompt(); - }; - ACCESSOR = /\s*([\w\.]+)(?:\.(\w*))$/; - SIMPLEVAR = /\s*(\w*)$/i; - autocomplete = function(text) { - return completeAttribute(text) || completeVariable(text) || [[], text]; - }; - completeAttribute = function(text) { - var all, completions, match, obj, prefix, val; - if (match = text.match(ACCESSOR)) { - all = match[0], obj = match[1], prefix = match[2]; - try { - val = Script.runInContext(obj, sandbox); - } catch (error) { - return; - } - completions = getCompletions(prefix, Object.getOwnPropertyNames(val)); - return [completions, prefix]; - } - }; - completeVariable = function(text) { - var completions, free, possibilities, vars, _ref; - if (free = (_ref = text.match(SIMPLEVAR)) != null ? _ref[1] : void 0) { - vars = Script.runInContext('Object.getOwnPropertyNames(this)', sandbox); - possibilities = vars.concat(CoffeeScript.RESERVED); - completions = getCompletions(free, possibilities); - return [completions, free]; - } - }; - getCompletions = function(prefix, candidates) { - var el, _j, _len2, _results; - _results = []; - for (_j = 0, _len2 = candidates.length; _j < _len2; _j++) { - el = candidates[_j]; - if (el.indexOf(prefix) === 0) { - _results.push(el); - } - } - return _results; - }; - process.on('uncaughtException', error); - if (readline.createInterface.length < 3) { - repl = readline.createInterface(stdin, autocomplete); - stdin.on('data', function(buffer) { - return repl.write(buffer); - }); - } else { - repl = readline.createInterface(stdin, stdout, autocomplete); - } - repl.on('attemptClose', function() { - if (backlog) { - backlog = ''; - process.stdout.write('\n'); - repl.setPrompt(REPL_PROMPT); - return repl.prompt(); - } else { - return repl.close(); - } - }); - repl.on('close', function() { - process.stdout.write('\n'); - return stdin.destroy(); - }); - repl.on('line', run); - repl.setPrompt(REPL_PROMPT); - repl.prompt(); -}).call(this); http://git-wip-us.apache.org/repos/asf/incubator-cordova-blackberry-webworks/blob/2329a568/bin/node_modules/coffee-script/lib/rewriter.js ---------------------------------------------------------------------- diff --git a/bin/node_modules/coffee-script/lib/rewriter.js b/bin/node_modules/coffee-script/lib/rewriter.js deleted file mode 100644 index d50a222..0000000 --- a/bin/node_modules/coffee-script/lib/rewriter.js +++ /dev/null @@ -1,363 +0,0 @@ -(function() { - var BALANCED_PAIRS, EXPRESSION_CLOSE, EXPRESSION_END, EXPRESSION_START, IMPLICIT_BLOCK, IMPLICIT_CALL, IMPLICIT_END, IMPLICIT_FUNC, IMPLICIT_UNSPACED_CALL, INVERSES, LINEBREAKS, SINGLE_CLOSERS, SINGLE_LINERS, left, rite, _i, _len, _ref; - var __indexOf = Array.prototype.indexOf || function(item) { - for (var i = 0, l = this.length; i < l; i++) { - if (this[i] === item) return i; - } - return -1; - }, __slice = Array.prototype.slice; - exports.Rewriter = (function() { - function Rewriter() {} - Rewriter.prototype.rewrite = function(tokens) { - this.tokens = tokens; - this.removeLeadingNewlines(); - this.removeMidExpressionNewlines(); - this.closeOpenCalls(); - this.closeOpenIndexes(); - this.addImplicitIndentation(); - this.tagPostfixConditionals(); - this.addImplicitBraces(); - this.addImplicitParentheses(); - this.ensureBalance(BALANCED_PAIRS); - this.rewriteClosingParens(); - return this.tokens; - }; - Rewriter.prototype.scanTokens = function(block) { - var i, token, tokens; - tokens = this.tokens; - i = 0; - while (token = tokens[i]) { - i += block.call(this, token, i, tokens); - } - return true; - }; - Rewriter.prototype.detectEnd = function(i, condition, action) { - var levels, token, tokens, _ref, _ref2; - tokens = this.tokens; - levels = 0; - while (token = tokens[i]) { - if (levels === 0 && condition.call(this, token, i)) { - return action.call(this, token, i); - } - if (!token || levels < 0) { - return action.call(this, token, i - 1); - } - if (_ref = token[0], __indexOf.call(EXPRESSION_START, _ref) >= 0) { - levels += 1; - } else if (_ref2 = token[0], __indexOf.call(EXPRESSION_END, _ref2) >= 0) { - levels -= 1; - } - i += 1; - } - return i - 1; - }; - Rewriter.prototype.removeLeadingNewlines = function() { - var i, tag, _len, _ref; - _ref = this.tokens; - for (i = 0, _len = _ref.length; i < _len; i++) { - tag = _ref[i][0]; - if (tag !== 'TERMINATOR') { - break; - } - } - if (i) { - return this.tokens.splice(0, i); - } - }; - Rewriter.prototype.removeMidExpressionNewlines = function() { - return this.scanTokens(function(token, i, tokens) { - var _ref; - if (!(token[0] === 'TERMINATOR' && (_ref = this.tag(i + 1), __indexOf.call(EXPRESSION_CLOSE, _ref) >= 0))) { - return 1; - } - tokens.splice(i, 1); - return 0; - }); - }; - Rewriter.prototype.closeOpenCalls = function() { - var action, condition; - condition = function(token, i) { - var _ref; - return ((_ref = token[0]) === ')' || _ref === 'CALL_END') || token[0] === 'OUTDENT' && this.tag(i - 1) === ')'; - }; - action = function(token, i) { - return this.tokens[token[0] === 'OUTDENT' ? i - 1 : i][0] = 'CALL_END'; - }; - return this.scanTokens(function(token, i) { - if (token[0] === 'CALL_START') { - this.detectEnd(i + 1, condition, action); - } - return 1; - }); - }; - Rewriter.prototype.closeOpenIndexes = function() { - var action, condition; - condition = function(token, i) { - var _ref; - return (_ref = token[0]) === ']' || _ref === 'INDEX_END'; - }; - action = function(token, i) { - return token[0] = 'INDEX_END'; - }; - return this.scanTokens(function(token, i) { - if (token[0] === 'INDEX_START') { - this.detectEnd(i + 1, condition, action); - } - return 1; - }); - }; - Rewriter.prototype.addImplicitBraces = function() { - var action, condition, stack, start, startIndent; - stack = []; - start = null; - startIndent = 0; - condition = function(token, i) { - var one, tag, three, two, _ref, _ref2; - _ref = this.tokens.slice(i + 1, (i + 3 + 1) || 9e9), one = _ref[0], two = _ref[1], three = _ref[2]; - if ('HERECOMMENT' === (one != null ? one[0] : void 0)) { - return false; - } - tag = token[0]; - return ((tag === 'TERMINATOR' || tag === 'OUTDENT') && !((two != null ? two[0] : void 0) === ':' || (one != null ? one[0] : void 0) === '@' && (three != null ? three[0] : void 0) === ':')) || (tag === ',' && one && ((_ref2 = one[0]) !== 'IDENTIFIER' && _ref2 !== 'NUMBER' && _ref2 !== 'STRING' && _ref2 !== '@' && _ref2 !== 'TERMINATOR' && _ref2 !== 'OUTDENT')); - }; - action = function(token, i) { - var tok; - tok = ['}', '}', token[2]]; - tok.generated = true; - return this.tokens.splice(i, 0, tok); - }; - return this.scanTokens(function(token, i, tokens) { - var ago, idx, tag, tok, value, _ref, _ref2; - if (_ref = (tag = token[0]), __indexOf.call(EXPRESSION_START, _ref) >= 0) { - stack.push([(tag === 'INDENT' && this.tag(i - 1) === '{' ? '{' : tag), i]); - return 1; - } - if (__indexOf.call(EXPRESSION_END, tag) >= 0) { - start = stack.pop(); - return 1; - } - if (!(tag === ':' && ((ago = this.tag(i - 2)) === ':' || ((_ref2 = stack[stack.length - 1]) != null ? _ref2[0] : void 0) !== '{'))) { - return 1; - } - stack.push(['{']); - idx = ago === '@' ? i - 2 : i - 1; - while (this.tag(idx - 2) === 'HERECOMMENT') { - idx -= 2; - } - value = new String('{'); - value.generated = true; - tok = ['{', value, token[2]]; - tok.generated = true; - tokens.splice(idx, 0, tok); - this.detectEnd(i + 2, condition, action); - return 2; - }); - }; - Rewriter.prototype.addImplicitParentheses = function() { - var action, noCall; - noCall = false; - action = function(token, i) { - var idx; - idx = token[0] === 'OUTDENT' ? i + 1 : i; - return this.tokens.splice(idx, 0, ['CALL_END', ')', token[2]]); - }; - return this.scanTokens(function(token, i, tokens) { - var callObject, current, next, prev, seenControl, seenSingle, tag, _ref, _ref2, _ref3; - tag = token[0]; - if (tag === 'CLASS' || tag === 'IF') { - noCall = true; - } - _ref = tokens.slice(i - 1, (i + 1 + 1) || 9e9), prev = _ref[0], current = _ref[1], next = _ref[2]; - callObject = !noCall && tag === 'INDENT' && next && next.generated && next[0] === '{' && prev && (_ref2 = prev[0], __indexOf.call(IMPLICIT_FUNC, _ref2) >= 0); - seenSingle = false; - seenControl = false; - if (__indexOf.call(LINEBREAKS, tag) >= 0) { - noCall = false; - } - if (prev && !prev.spaced && tag === '?') { - token.call = true; - } - if (token.fromThen) { - return 1; - } - if (!(callObject || (prev != null ? prev.spaced : void 0) && (prev.call || (_ref3 = prev[0], __indexOf.call(IMPLICIT_FUNC, _ref3) >= 0)) && (__indexOf.call(IMPLICIT_CALL, tag) >= 0 || !(token.spaced || token.newLine) && __indexOf.call(IMPLICIT_UNSPACED_CALL, tag) >= 0))) { - return 1; - } - tokens.splice(i, 0, ['CALL_START', '(', token[2]]); - this.detectEnd(i + 1, function(token, i) { - var post, _ref4; - tag = token[0]; - if (!seenSingle && token.fromThen) { - return true; - } - if (tag === 'IF' || tag === 'ELSE' || tag === 'CATCH' || tag === '->' || tag === '=>') { - seenSingle = true; - } - if (tag === 'IF' || tag === 'ELSE' || tag === 'SWITCH' || tag === 'TRY') { - seenControl = true; - } - if ((tag === '.' || tag === '?.' || tag === '::') && this.tag(i - 1) === 'OUTDENT') { - return true; - } - return !token.generated && this.tag(i - 1) !== ',' && (__indexOf.call(IMPLICIT_END, tag) >= 0 || (tag === 'INDENT' && !seenControl)) && (tag !== 'INDENT' || (this.tag(i - 2) !== 'CLASS' && (_ref4 = this.tag(i - 1), __indexOf.call(IMPLICIT_BLOCK, _ref4) < 0) && !((post = this.tokens[i + 1]) && post.generated && post[0] === '{'))); - }, action); - if (prev[0] === '?') { - prev[0] = 'FUNC_EXIST'; - } - return 2; - }); - }; - Rewriter.prototype.addImplicitIndentation = function() { - return this.scanTokens(function(token, i, tokens) { - var action, condition, indent, outdent, starter, tag, _ref, _ref2; - tag = token[0]; - if (tag === 'TERMINATOR' && this.tag(i + 1) === 'THEN') { - tokens.splice(i, 1); - return 0; - } - if (tag === 'ELSE' && this.tag(i - 1) !== 'OUTDENT') { - tokens.splice.apply(tokens, [i, 0].concat(__slice.call(this.indentation(token)))); - return 2; - } - if (tag === 'CATCH' && ((_ref = this.tag(i + 2)) === 'OUTDENT' || _ref === 'TERMINATOR' || _ref === 'FINALLY')) { - tokens.splice.apply(tokens, [i + 2, 0].concat(__slice.call(this.indentation(token)))); - return 4; - } - if (__indexOf.call(SINGLE_LINERS, tag) >= 0 && this.tag(i + 1) !== 'INDENT' && !(tag === 'ELSE' && this.tag(i + 1) === 'IF')) { - starter = tag; - _ref2 = this.indentation(token), indent = _ref2[0], outdent = _ref2[1]; - if (starter === 'THEN') { - indent.fromThen = true; - } - indent.generated = outdent.generated = true; - tokens.splice(i + 1, 0, indent); - condition = function(token, i) { - var _ref3; - return token[1] !== ';' && (_ref3 = token[0], __indexOf.call(SINGLE_CLOSERS, _ref3) >= 0) && !(token[0] === 'ELSE' && (starter !== 'IF' && starter !== 'THEN')); - }; - action = function(token, i) { - return this.tokens.splice((this.tag(i - 1) === ',' ? i - 1 : i), 0, outdent); - }; - this.detectEnd(i + 2, condition, action); - if (tag === 'THEN') { - tokens.splice(i, 1); - } - return 1; - } - return 1; - }); - }; - Rewriter.prototype.tagPostfixConditionals = function() { - var condition; - condition = function(token, i) { - var _ref; - return (_ref = token[0]) === 'TERMINATOR' || _ref === 'INDENT'; - }; - return this.scanTokens(function(token, i) { - var original; - if (token[0] !== 'IF') { - return 1; - } - original = token; - this.detectEnd(i + 1, condition, function(token, i) { - if (token[0] !== 'INDENT') { - return original[0] = 'POST_' + original[0]; - } - }); - return 1; - }); - }; - Rewriter.prototype.ensureBalance = function(pairs) { - var close, level, levels, open, openLine, tag, token, _i, _j, _len, _len2, _ref, _ref2; - levels = {}; - openLine = {}; - _ref = this.tokens; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - token = _ref[_i]; - tag = token[0]; - for (_j = 0, _len2 = pairs.length; _j < _len2; _j++) { - _ref2 = pairs[_j], open = _ref2[0], close = _ref2[1]; - levels[open] |= 0; - if (tag === open) { - if (levels[open]++ === 0) { - openLine[open] = token[2]; - } - } else if (tag === close && --levels[open] < 0) { - throw Error("too many " + token[1] + " on line " + (token[2] + 1)); - } - } - } - for (open in levels) { - level = levels[open]; - if (level > 0) { - throw Error("unclosed " + open + " on line " + (openLine[open] + 1)); - } - } - return this; - }; - Rewriter.prototype.rewriteClosingParens = function() { - var debt, key, stack; - stack = []; - debt = {}; - for (key in INVERSES) { - debt[key] = 0; - } - return this.scanTokens(function(token, i, tokens) { - var inv, match, mtag, oppos, tag, val, _ref; - if (_ref = (tag = token[0]), __indexOf.call(EXPRESSION_START, _ref) >= 0) { - stack.push(token); - return 1; - } - if (__indexOf.call(EXPRESSION_END, tag) < 0) { - return 1; - } - if (debt[inv = INVERSES[tag]] > 0) { - debt[inv] -= 1; - tokens.splice(i, 1); - return 0; - } - match = stack.pop(); - mtag = match[0]; - oppos = INVERSES[mtag]; - if (tag === oppos) { - return 1; - } - debt[mtag] += 1; - val = [oppos, mtag === 'INDENT' ? match[1] : oppos]; - if (this.tag(i + 2) === mtag) { - tokens.splice(i + 3, 0, val); - stack.push(match); - } else { - tokens.splice(i, 0, val); - } - return 1; - }); - }; - Rewriter.prototype.indentation = function(token) { - return [['INDENT', 2, token[2]], ['OUTDENT', 2, token[2]]]; - }; - Rewriter.prototype.tag = function(i) { - var _ref; - return (_ref = this.tokens[i]) != null ? _ref[0] : void 0; - }; - return Rewriter; - })(); - BALANCED_PAIRS = [['(', ')'], ['[', ']'], ['{', '}'], ['INDENT', 'OUTDENT'], ['CALL_START', 'CALL_END'], ['PARAM_START', 'PARAM_END'], ['INDEX_START', 'INDEX_END']]; - INVERSES = {}; - EXPRESSION_START = []; - EXPRESSION_END = []; - for (_i = 0, _len = BALANCED_PAIRS.length; _i < _len; _i++) { - _ref = BALANCED_PAIRS[_i], left = _ref[0], rite = _ref[1]; - EXPRESSION_START.push(INVERSES[rite] = left); - EXPRESSION_END.push(INVERSES[left] = rite); - } - EXPRESSION_CLOSE = ['CATCH', 'WHEN', 'ELSE', 'FINALLY'].concat(EXPRESSION_END); - IMPLICIT_FUNC = ['IDENTIFIER', 'SUPER', ')', 'CALL_END', ']', 'INDEX_END', '@', 'THIS']; - IMPLICIT_CALL = ['IDENTIFIER', 'NUMBER', 'STRING', 'JS', 'REGEX', 'NEW', 'PARAM_START', 'CLASS', 'IF', 'TRY', 'SWITCH', 'THIS', 'BOOL', 'UNARY', 'SUPER', '@', '->', '=>', '[', '(', '{', '--', '++']; - IMPLICIT_UNSPACED_CALL = ['+', '-']; - IMPLICIT_BLOCK = ['->', '=>', '{', '[', ',']; - IMPLICIT_END = ['POST_IF', 'FOR', 'WHILE', 'UNTIL', 'WHEN', 'BY', 'LOOP', 'TERMINATOR']; - SINGLE_LINERS = ['ELSE', '->', '=>', 'TRY', 'FINALLY', 'THEN']; - SINGLE_CLOSERS = ['TERMINATOR', 'CATCH', 'FINALLY', 'ELSE', 'OUTDENT', 'LEADING_WHEN']; - LINEBREAKS = ['TERMINATOR', 'INDENT', 'OUTDENT']; -}).call(this); http://git-wip-us.apache.org/repos/asf/incubator-cordova-blackberry-webworks/blob/2329a568/bin/node_modules/coffee-script/lib/scope.js ---------------------------------------------------------------------- diff --git a/bin/node_modules/coffee-script/lib/scope.js b/bin/node_modules/coffee-script/lib/scope.js deleted file mode 100644 index ab88ba9..0000000 --- a/bin/node_modules/coffee-script/lib/scope.js +++ /dev/null @@ -1,120 +0,0 @@ -(function() { - var Scope, extend, last, _ref; - _ref = require('./helpers'), extend = _ref.extend, last = _ref.last; - exports.Scope = Scope = (function() { - Scope.root = null; - function Scope(parent, expressions, method) { - this.parent = parent; - this.expressions = expressions; - this.method = method; - this.variables = [ - { - name: 'arguments', - type: 'arguments' - } - ]; - this.positions = {}; - if (!this.parent) { - Scope.root = this; - } - } - Scope.prototype.add = function(name, type, immediate) { - var pos; - if (this.shared && !immediate) { - return this.parent.add(name, type, immediate); - } - if (typeof (pos = this.positions[name]) === 'number') { - return this.variables[pos].type = type; - } else { - return this.positions[name] = this.variables.push({ - name: name, - type: type - }) - 1; - } - }; - Scope.prototype.find = function(name, options) { - if (this.check(name, options)) { - return true; - } - this.add(name, 'var'); - return false; - }; - Scope.prototype.parameter = function(name) { - if (this.shared && this.parent.check(name, true)) { - return; - } - return this.add(name, 'param'); - }; - Scope.prototype.check = function(name, immediate) { - var found, _ref2; - found = !!this.type(name); - if (found || immediate) { - return found; - } - return !!((_ref2 = this.parent) != null ? _ref2.check(name) : void 0); - }; - Scope.prototype.temporary = function(name, index) { - if (name.length > 1) { - return '_' + name + (index > 1 ? index : ''); - } else { - return '_' + (index + parseInt(name, 36)).toString(36).replace(/\d/g, 'a'); - } - }; - Scope.prototype.type = function(name) { - var v, _i, _len, _ref2; - _ref2 = this.variables; - for (_i = 0, _len = _ref2.length; _i < _len; _i++) { - v = _ref2[_i]; - if (v.name === name) { - return v.type; - } - } - return null; - }; - Scope.prototype.freeVariable = function(type) { - var index, temp; - index = 0; - while (this.check((temp = this.temporary(type, index)))) { - index++; - } - this.add(temp, 'var', true); - return temp; - }; - Scope.prototype.assign = function(name, value) { - this.add(name, { - value: value, - assigned: true - }); - return this.hasAssignments = true; - }; - Scope.prototype.hasDeclarations = function() { - return !!this.declaredVariables().length; - }; - Scope.prototype.declaredVariables = function() { - var realVars, tempVars, v, _i, _len, _ref2; - realVars = []; - tempVars = []; - _ref2 = this.variables; - for (_i = 0, _len = _ref2.length; _i < _len; _i++) { - v = _ref2[_i]; - if (v.type === 'var') { - (v.name.charAt(0) === '_' ? tempVars : realVars).push(v.name); - } - } - return realVars.sort().concat(tempVars.sort()); - }; - Scope.prototype.assignedVariables = function() { - var v, _i, _len, _ref2, _results; - _ref2 = this.variables; - _results = []; - for (_i = 0, _len = _ref2.length; _i < _len; _i++) { - v = _ref2[_i]; - if (v.type.assigned) { - _results.push("" + v.name + " = " + v.type.value); - } - } - return _results; - }; - return Scope; - })(); -}).call(this); http://git-wip-us.apache.org/repos/asf/incubator-cordova-blackberry-webworks/blob/2329a568/bin/node_modules/coffee-script/package.json ---------------------------------------------------------------------- diff --git a/bin/node_modules/coffee-script/package.json b/bin/node_modules/coffee-script/package.json deleted file mode 100644 index 58210ed..0000000 --- a/bin/node_modules/coffee-script/package.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "name": "coffee-script", - "description": "Unfancy JavaScript", - "keywords": ["javascript", "language", "coffeescript", "compiler"], - "author": "Jeremy Ashkenas", - "version": "1.1.2", - "licenses": [{ - "type": "MIT", - "url": "http://github.com/jashkenas/coffee-script/raw/master/LICENSE" - }], - "engines": { - "node": ">=0.2.5" - }, - "directories" : { - "lib" : "./lib" - }, - "main" : "./lib/coffee-script", - "bin": { - "coffee": "./bin/coffee", - "cake": "./bin/cake" - }, - "homepage": "http://coffeescript.org", - "repository": { - "type": "git", - "url": "git://github.com/jashkenas/coffee-script.git" - } -} http://git-wip-us.apache.org/repos/asf/incubator-cordova-blackberry-webworks/blob/2329a568/bin/node_modules/nodeunit/.npmignore ---------------------------------------------------------------------- diff --git a/bin/node_modules/nodeunit/.npmignore b/bin/node_modules/nodeunit/.npmignore deleted file mode 100644 index 1a82501..0000000 --- a/bin/node_modules/nodeunit/.npmignore +++ /dev/null @@ -1,3 +0,0 @@ -dist -stamp-build -test/fixtures/dir2 http://git-wip-us.apache.org/repos/asf/incubator-cordova-blackberry-webworks/blob/2329a568/bin/node_modules/nodeunit/CONTRIBUTORS.md ---------------------------------------------------------------------- diff --git a/bin/node_modules/nodeunit/CONTRIBUTORS.md b/bin/node_modules/nodeunit/CONTRIBUTORS.md deleted file mode 100644 index cd4bdeb..0000000 --- a/bin/node_modules/nodeunit/CONTRIBUTORS.md +++ /dev/null @@ -1,60 +0,0 @@ -Nodeunit contributors (sorted alphabeticaly) -============================================ - -* **[Alex Gorbatchev](https://github.com/alexgorbatchev)** - - * Deeper default object inspection - * Timeout to ensure flushing of console output (default reporter) - -* **[Alex Wolfe](https://github.com/alexkwolfe)** - - * HTML test reporter - -* **[Caolan McMahon](https://github.com/caolan)** - - * Author and maintainer - * Most features develpopment - -* **[Carl Fürstenberg](https://github.com/azatoth)** - - * Debian-friendly Makefile, supports both 'node' and 'nodejs' executables - * Sandbox utility - * Minimal test reporter - -* **[Gerad Suyderhoud](https://github.com/gerad)** - - * First comand-line tool - -* **[Kadir Pekel](https://github.com/coffeemate)** - - * Improvements to default test reporter - * HTTP test utility - -* **[Matthias Lübken](https://github.com/luebken)** - - * Utility functions for tracking incomplete tests on exit - -* **[Oleg Efimov](https://github.com/Sannis)** - - * Adding 'make lint' and fixing nodelint errors - * Option parsing, --help text and config file support - * Reporters option for command-line tool - -* **[Orlando Vazquez](https://github.com/orlandov)** - - * Added jUnit XML reporter - -* **[Ryan Dahl](https://github.com/ry)** - - * Add package.json - -* **[Sam Stephenson](https://github.com/sstephenson)** - - * Coffee-script support - -* **[Thomas Mayfield](https://github.com/thegreatape)** - - * Async setUp and tearDown support for testCase - -**[Full contributors list](https://github.com/caolan/nodeunit/contributors).** - http://git-wip-us.apache.org/repos/asf/incubator-cordova-blackberry-webworks/blob/2329a568/bin/node_modules/nodeunit/LICENSE ---------------------------------------------------------------------- diff --git a/bin/node_modules/nodeunit/LICENSE b/bin/node_modules/nodeunit/LICENSE deleted file mode 100644 index b7f9d50..0000000 --- a/bin/node_modules/nodeunit/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2010 Caolan McMahon - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. http://git-wip-us.apache.org/repos/asf/incubator-cordova-blackberry-webworks/blob/2329a568/bin/node_modules/nodeunit/Makefile ---------------------------------------------------------------------- diff --git a/bin/node_modules/nodeunit/Makefile b/bin/node_modules/nodeunit/Makefile deleted file mode 100644 index da1b2fb..0000000 --- a/bin/node_modules/nodeunit/Makefile +++ /dev/null @@ -1,126 +0,0 @@ -PACKAGE = nodeunit -NODEJS = $(if $(shell test -f /usr/bin/nodejs && echo "true"),nodejs,node) - -PREFIX ?= /usr/local -BINDIR ?= $(PREFIX)/bin -DATADIR ?= $(PREFIX)/share -MANDIR ?= $(PREFIX)/share/man -LIBDIR ?= $(PREFIX)/lib -NODEJSLIBDIR ?= $(LIBDIR)/$(NODEJS) - -BUILDDIR = dist - -DOCS = $(shell find doc -name '*.md' \ - |sed 's|.md|.1|g' \ - |sed 's|doc/|man1/|g' \ - ) - - -$(shell if [ ! -d $(BUILDDIR) ]; then mkdir $(BUILDDIR); fi) - -all: build doc - -browser: - # super hacky build script for browser version! - mkdir -p $(BUILDDIR)/browser - rm -rf $(BUILDDIR)/browser/* - # build browser version of nodeunit.js - cat share/license.js >> $(BUILDDIR)/browser/nodeunit.js - echo "nodeunit = (function(){" >> $(BUILDDIR)/browser/nodeunit.js - cat deps/json2.js >> $(BUILDDIR)/browser/nodeunit.js - # make assert global - echo "var assert = this.assert = {};" >> $(BUILDDIR)/browser/nodeunit.js - echo "var types = {};" >> $(BUILDDIR)/browser/nodeunit.js - echo "var core = {};" >> $(BUILDDIR)/browser/nodeunit.js - echo "var nodeunit = {};" >> $(BUILDDIR)/browser/nodeunit.js - echo "var reporter = {};" >> $(BUILDDIR)/browser/nodeunit.js - cat deps/async.js >> $(BUILDDIR)/browser/nodeunit.js - echo "(function(exports){" >> $(BUILDDIR)/browser/nodeunit.js - cat lib/assert.js >> $(BUILDDIR)/browser/nodeunit.js - echo "})(assert);" >> $(BUILDDIR)/browser/nodeunit.js - echo "(function(exports){" >> $(BUILDDIR)/browser/nodeunit.js - cat lib/types.js >> $(BUILDDIR)/browser/nodeunit.js - echo "})(types);" >> $(BUILDDIR)/browser/nodeunit.js - echo "(function(exports){" >> $(BUILDDIR)/browser/nodeunit.js - cat lib/core.js >> $(BUILDDIR)/browser/nodeunit.js - echo "})(core);" >> $(BUILDDIR)/browser/nodeunit.js - echo "(function(exports){" >> $(BUILDDIR)/browser/nodeunit.js - cat lib/reporters/browser.js >> $(BUILDDIR)/browser/nodeunit.js - echo "})(reporter);" >> $(BUILDDIR)/browser/nodeunit.js - echo "nodeunit = core;" >> $(BUILDDIR)/browser/nodeunit.js - echo "nodeunit.assert = assert;" >> $(BUILDDIR)/browser/nodeunit.js - echo "nodeunit.reporter = reporter;" >> $(BUILDDIR)/browser/nodeunit.js - echo "nodeunit.run = reporter.run;" >> $(BUILDDIR)/browser/nodeunit.js - echo "return nodeunit; })();" >> $(BUILDDIR)/browser/nodeunit.js - sed -i "/\@REMOVE_LINE_FOR_BROWSER/d" $(BUILDDIR)/browser/nodeunit.js - # copy nodeunit.css - cp share/nodeunit.css $(BUILDDIR)/browser/nodeunit.css - # create nodeunit.min.js - uglifyjs $(BUILDDIR)/browser/nodeunit.js > $(BUILDDIR)/browser/nodeunit.min.js - # create test scripts - mkdir -p $(BUILDDIR)/browser/test - cp test/test.html $(BUILDDIR)/browser/test/test.html - # test-base.js - echo "(function (exports) {" > $(BUILDDIR)/browser/test/test-base.js - cat test/test-base.js >> $(BUILDDIR)/browser/test/test-base.js - echo "})(this.test_base = {});" >> $(BUILDDIR)/browser/test/test-base.js - sed -i "/\@REMOVE_LINE_FOR_BROWSER/d" $(BUILDDIR)/browser/test/test-base.js - # test-runmodule.js - echo "(function (exports) {" > $(BUILDDIR)/browser/test/test-runmodule.js - cat test/test-runmodule.js >> $(BUILDDIR)/browser/test/test-runmodule.js - echo "})(this.test_runmodule = {});" >> $(BUILDDIR)/browser/test/test-runmodule.js - sed -i "/\@REMOVE_LINE_FOR_BROWSER/d" $(BUILDDIR)/browser/test/test-runmodule.js - # test-runtest.js - echo "(function (exports) {" > $(BUILDDIR)/browser/test/test-runtest.js - cat test/test-runtest.js >> $(BUILDDIR)/browser/test/test-runtest.js - echo "})(this.test_runtest = {});" >> $(BUILDDIR)/browser/test/test-runtest.js - sed -i "/\@REMOVE_LINE_FOR_BROWSER/d" $(BUILDDIR)/browser/test/test-runtest.js - # test-testcase.js - echo "(function (exports) {" > $(BUILDDIR)/browser/test/test-testcase.js - cat test/test-testcase.js >> $(BUILDDIR)/browser/test/test-testcase.js - echo "})(this.test_testcase = {});" >> $(BUILDDIR)/browser/test/test-testcase.js - sed -i "/\@REMOVE_LINE_FOR_BROWSER/d" $(BUILDDIR)/browser/test/test-testcase.js - # copy nodeunit.js to dist/browser/test to make it easier for me to host and - # run on windows VMs with IE - cp $(BUILDDIR)/browser/nodeunit.js $(BUILDDIR)/browser/test/nodeunit.js - cp $(BUILDDIR)/browser/nodeunit.css $(BUILDDIR)/browser/test/nodeunit.css - -build: stamp-build - -stamp-build: $(wildcard deps/* lib/*.js) - touch $@; - mkdir -p $(BUILDDIR)/nodeunit - cp -R bin deps index.js lib package.json $(BUILDDIR)/nodeunit - printf '#!/bin/sh\n$(NODEJS) $(NODEJSLIBDIR)/$(PACKAGE)/bin/nodeunit $$@' > $(BUILDDIR)/nodeunit.sh - -test: - $(NODEJS) ./bin/nodeunit test - -install: build - install -d $(NODEJSLIBDIR) - cp -a $(BUILDDIR)/nodeunit $(NODEJSLIBDIR) - install -m 0755 $(BUILDDIR)/nodeunit.sh $(BINDIR)/nodeunit - install -d $(MANDIR)/man1/ - cp -a man1/nodeunit.1 $(MANDIR)/man1/ - -uninstall: - rm -rf $(NODEJSLIBDIR)/nodeunit $(NODEJSLIBDIR)/nodeunit.js $(BINDIR)/nodeunit - rm -rf $(MANDIR)/man1/nodeunit.1 - -clean: - rm -rf $(BUILDDIR) stamp-build - -lint: - nodelint --config nodelint.cfg ./index.js ./bin/nodeunit ./bin/nodeunit.json ./lib/*.js ./lib/reporters/*.js ./test/*.js - -doc: man1 $(DOCS) - @true - -man1: - @if ! test -d man1 ; then mkdir -p man1 ; fi - -# use `npm install ronn` for this to work. -man1/%.1: doc/%.md - ronn --roff $< > $@ - -.PHONY: browser test install uninstall build all http://git-wip-us.apache.org/repos/asf/incubator-cordova-blackberry-webworks/blob/2329a568/bin/node_modules/nodeunit/README.md ---------------------------------------------------------------------- diff --git a/bin/node_modules/nodeunit/README.md b/bin/node_modules/nodeunit/README.md deleted file mode 100644 index 6a7da6a..0000000 --- a/bin/node_modules/nodeunit/README.md +++ /dev/null @@ -1,432 +0,0 @@ -Nodeunit -======== - -Simple syntax, powerful tools. Nodeunit provides easy async unit testing for -node.js and the browser. - -* Simple to use -* Just export the tests from a module -* Works with node.js and in the browser. -* Helps you avoid common pitfalls when testing asynchronous code -* Easy to add test cases with setUp and tearDown functions if you wish -* Flexible reporters for custom output, built-in support for HTML and jUnit XML -* Allows the use of mocks and stubs - -__Contributors__ - -* [alexgorbatchev](https://github.com/alexgorbatchev) -* [alexkwolfe](https://github.com/alexkwolfe) -* [azatoth](https://github.com/azatoth) -* [coffeemate](https://github.com/coffeemate) -* [luebken](https://github.com/luebken) -* [orlandov](https://github.com/orlandov) -* [Sannis](https://github.com/Sannis) -* [sstephenson](https://github.com/sstephenson) -* [thegreatape](https://github.com/thegreatape) -* and thanks to [cjohansen](https://github.com/cjohansen) for input and advice - on implementing setUp and tearDown functions. See - [cjohansen's fork](https://github.com/cjohansen/nodeunit). - -Also, check out gerad's [nodeunit-dsl](https://github.com/gerad/nodeunit-dsl) -project, which implements a 'pretty dsl on top of nodeunit'. - -More contributor information can be found in the -[CONTRIBUTORS.md](https://github.com/caolan/nodeunit/blob/master/CONTRIBUTORS.md) -file. - -Usage ------ - -Here is an example unit test module: - - exports.testSomething = function(test){ - test.expect(1); - test.ok(true, "this assertion should pass"); - test.done(); - }; - - exports.testSomethingElse = function(test){ - test.ok(false, "this assertion should fail"); - test.done(); - }; - -When run using the included test runner, this will output the following: - - - -Installation ------------- - -There are two options for installing nodeunit: - -1. Clone / download nodeunit from [github](https://github.com/caolan/nodeunit), - then: - - make && sudo make install - -2. Install via npm: - - npm install nodeunit - -API Documentation ------------------ - -Nodeunit uses the functions available in the node.js -[assert module](http://nodejs.org/docs/v0.4.2/api/assert.html): - -* __ok(value, [message])__ - Tests if value is a true value. -* __equal(actual, expected, [message])__ - Tests shallow, coercive equality - with the equal comparison operator ( == ). -* __notEqual(actual, expected, [message])__ - Tests shallow, coercive - non-equality with the not equal comparison operator ( != ). -* __deepEqual(actual, expected, [message])__ - Tests for deep equality. -* __notDeepEqual(actual, expected, [message])__ - Tests for any deep - inequality. -* __strictEqual(actual, expected, [message])__ - Tests strict equality, as - determined by the strict equality operator ( === ) -* __notStrictEqual(actual, expected, [message])__ - Tests strict non-equality, - as determined by the strict not equal operator ( !== ) -* __throws(block, [error], [message])__ - Expects block to throw an error. -* __doesNotThrow(block, [error], [message])__ - Expects block not to throw an - error. -* __ifError(value)__ - Tests if value is not a false value, throws if it is a - true value. Useful when testing the first argument, error in callbacks. - -Nodeunit also provides the following functions within tests: - -* __expect(amount)__ - Specify how many assertions are expected to run within a - test. Very useful for ensuring that all your callbacks and assertions are - run. -* __done()__ - Finish the current test function, and move on to the next. ALL - tests should call this! - -Nodeunit aims to be simple and easy to learn. This is achieved through using -existing structures (such as node.js modules) to maximum effect, and reducing -the API where possible, to make it easier to digest. - -Tests are simply exported from a module, but they are still run in the order -they are defined. - -__Note:__ Users of old nodeunit versions may remember using ok, equals and same -in the style of qunit, instead of the assert functions above. These functions -still exist for backwards compatibility, and are simply aliases to their assert -module counterparts. - - -Asynchronous Testing --------------------- - -When testing asynchronous code, there are a number of sharp edges to watch out -for. Thankfully, nodeunit is designed to help you avoid as many of these -pitfalls as possible. For the most part, testing asynchronous code in nodeunit -_just works_. - - -### Tests run in series - -While running tests in parallel seems like a good idea for speeding up your -test suite, in practice I've found it means writing much more complicated -tests. Because of node's module cache, running tests in parallel means mocking -and stubbing is pretty much impossible. One of the nicest things about testing -in javascript is the ease of doing stubs: - - var _readFile = fs.readFile; - fs.readFile = function(path, callback){ - // its a stub! - }; - // test function that uses fs.readFile - - // we're done - fs.readFile = _readFile; - -You cannot do this when running tests in parallel. In order to keep testing as -simple as possible, nodeunit avoids it. Thankfully, most unit-test suites run -fast anyway. - - -### Explicit ending of tests - -When testing async code its important that tests end at the correct point, not -just after a given number of assertions. Otherwise your tests can run short, -ending before all assertions have completed. Its important to detect too -many assertions as well as too few. Combining explicit ending of tests with -an expected number of assertions helps to avoid false test passes, so be sure -to use the test.expect() method at the start of your test functions, and -test.done() when finished. - - -Groups, setUp and tearDown --------------------------- - -Nodeunit allows the nesting of test functions: - - exports.test1 = function (test) { - ... - } - - exports.group = { - test2: function (test) { - ... - }, - test3: function (test) { - ... - } - } - -This would be run as: - - test1 - group - test2 - group - test3 - -Using these groups its possible to add setUp and tearDown functions to your -tests. Nodeunit has a utility function called testCase which allows you to -define a setUp function, which is run before each test, and a tearDown -function, which is run after each test calls test.done(): - - var testCase = require('nodeunit').testCase; - - module.exports = testCase({ - setUp: function (callback) { - this.foo = 'bar'; - callback(); - }, - tearDown: function (callback) { - // clean up - callback(); - }, - test1: function (test) { - test.equals(this.foo, 'bar'); - test.done(); - } - }); - -In this way, its possible to have multiple groups of tests in a module, each -group with its own setUp and tearDown functions. - - -Running Tests -------------- - -Nodeunit comes with a basic command-line test runner, which can be installed -using 'sudo make install'. Example usage: - - nodeunit testmodule1.js testfolder [...] - -The default test reporter uses color output, because I think that's more fun :) I -intend to add a no-color option in future. To give you a feeling of the fun you'll -be having writing tests, lets fix the example at the start of the README: - - - -Ahhh, Doesn't that feel better? - -When using the included test runner, it will exit using the failed number of -assertions as the exit code. Exiting with 0 when all tests pass. - - -### Command-line Options - -* __--reporter FILE__ - you can set the test reporter to a custom module or -on of the modules in nodeunit/lib/reporters, when omitted, the default test runner -is used. -* __--list-reporters__ - list available build-in reporters. -* __--config FILE__ - load config options from a JSON file, allows -the customisation of color schemes for the default test reporter etc. See -bin/nodeunit.json for current available options. -* __--version__ or __-v__ - report nodeunit version -* __--help__ - show nodeunit help - - -Running tests in the browser ----------------------------- - -Nodeunit tests can also be run inside the browser. For example usage, see -the examples/browser folder. The basic syntax is as follows: - -__test.html__ - - - - Example Test Suite - - - - - - -

b ? 1 : 0; - }; - callback(null, _map(results.sort(fn), function (x) { - return x.value; - })); - } - }); - }; - - async.auto = function (tasks, callback) { - callback = callback || function () {}; - var keys = _keys(tasks); - if (!keys.length) { - return callback(null); - } - - var completed = []; - - var listeners = []; - var addListener = function (fn) { - listeners.unshift(fn); - }; - var removeListener = function (fn) { - for (var i = 0; i < listeners.length; i += 1) { - if (listeners[i] === fn) { - listeners.splice(i, 1); - return; - } - } - }; - var taskComplete = function () { - _forEach(listeners, function (fn) { - fn(); - }); - }; - - addListener(function () { - if (completed.length === keys.length) { - callback(null); - } - }); - - _forEach(keys, function (k) { - var task = (tasks[k] instanceof Function) ? [tasks[k]]: tasks[k]; - var taskCallback = function (err) { - if (err) { - callback(err); - // stop subsequent errors hitting callback multiple times - callback = function () {}; - } - else { - completed.push(k); - taskComplete(); - } - }; - var requires = task.slice(0, Math.abs(task.length - 1)) || []; - var ready = function () { - return _reduce(requires, function (a, x) { - return (a && _indexOf(completed, x) !== -1); - }, true); - }; - if (ready()) { - task[task.length - 1](taskCallback); - } - else { - var listener = function () { - if (ready()) { - removeListener(listener); - task[task.length - 1](taskCallback); - } - }; - addListener(listener); - } - }); - }; - - async.waterfall = function (tasks, callback) { - if (!tasks.length) { - return callback(); - } - callback = callback || function () {}; - var wrapIterator = function (iterator) { - return function (err) { - if (err) { - callback(err); - callback = function () {}; - } - else { - var args = Array.prototype.slice.call(arguments, 1); - var next = iterator.next(); - if (next) { - args.push(wrapIterator(next)); - } - else { - args.push(callback); - } - async.nextTick(function () { - iterator.apply(null, args); - }); - } - }; - }; - wrapIterator(async.iterator(tasks))(); - }; - - async.parallel = function (tasks, callback) { - callback = callback || function () {}; - if (tasks.constructor === Array) { - async.map(tasks, function (fn, callback) { - if (fn) { - fn(function (err) { - var args = Array.prototype.slice.call(arguments, 1); - if (args.length <= 1) { - args = args[0]; - } - callback.call(null, err, args || null); - }); - } - }, callback); - } - else { - var results = {}; - async.forEach(_keys(tasks), function (k, callback) { - tasks[k](function (err) { - var args = Array.prototype.slice.call(arguments, 1); - if (args.length <= 1) { - args = args[0]; - } - results[k] = args; - callback(err); - }); - }, function (err) { - callback(err, results); - }); - } - }; - - async.series = function (tasks, callback) { - callback = callback || function () {}; - if (tasks.constructor === Array) { - async.mapSeries(tasks, function (fn, callback) { - if (fn) { - fn(function (err) { - var args = Array.prototype.slice.call(arguments, 1); - if (args.length <= 1) { - args = args[0]; - } - callback.call(null, err, args || null); - }); - } - }, callback); - } - else { - var results = {}; - async.forEachSeries(_keys(tasks), function (k, callback) { - tasks[k](function (err) { - var args = Array.prototype.slice.call(arguments, 1); - if (args.length <= 1) { - args = args[0]; - } - results[k] = args; - callback(err); - }); - }, function (err) { - callback(err, results); - }); - } - }; - - async.iterator = function (tasks) { - var makeCallback = function (index) { - var fn = function () { - if (tasks.length) { - tasks[index].apply(null, arguments); - } - return fn.next(); - }; - fn.next = function () { - return (index < tasks.length - 1) ? makeCallback(index + 1): null; - }; - return fn; - }; - return makeCallback(0); - }; - - async.apply = function (fn) { - var args = Array.prototype.slice.call(arguments, 1); - return function () { - return fn.apply( - null, args.concat(Array.prototype.slice.call(arguments)) - ); - }; - }; - - var _concat = function (eachfn, arr, fn, callback) { - var r = []; - eachfn(arr, function (x, cb) { - fn(x, function (err, y) { - r = r.concat(y || []); - cb(err); - }); - }, function (err) { - callback(err, r); - }); - }; - async.concat = doParallel(_concat); - async.concatSeries = doSeries(_concat); - - async.whilst = function (test, iterator, callback) { - if (test()) { - iterator(function (err) { - if (err) { - return callback(err); - } - async.whilst(test, iterator, callback); - }); - } - else { - callback(); - } - }; - - async.until = function (test, iterator, callback) { - if (!test()) { - iterator(function (err) { - if (err) { - return callback(err); - } - async.until(test, iterator, callback); - }); - } - else { - callback(); - } - }; - - async.queue = function (worker, concurrency) { - var workers = 0; - var tasks = []; - var q = { - concurrency: concurrency, - push: function (data, callback) { - tasks.push({data: data, callback: callback}); - async.nextTick(q.process); - }, - process: function () { - if (workers < q.concurrency && tasks.length) { - var task = tasks.splice(0, 1)[0]; - workers += 1; - worker(task.data, function () { - workers -= 1; - if (task.callback) { - task.callback.apply(task, arguments); - } - q.process(); - }); - } - }, - length: function () { - return tasks.length; - } - }; - return q; - }; - - var _console_fn = function (name) { - return function (fn) { - var args = Array.prototype.slice.call(arguments, 1); - fn.apply(null, args.concat([function (err) { - var args = Array.prototype.slice.call(arguments, 1); - if (typeof console !== 'undefined') { - if (err) { - if (console.error) { - console.error(err); - } - } - else if (console[name]) { - _forEach(args, function (x) { - console[name](x); - }); - } - } - }])); - }; - }; - async.log = _console_fn('log'); - async.dir = _console_fn('dir'); - /*async.info = _console_fn('info'); - async.warn = _console_fn('warn'); - async.error = _console_fn('error');*/ - - async.memoize = function (fn, hasher) { - var memo = {}; - hasher = hasher || function (x) { - return x; - }; - return function () { - var args = Array.prototype.slice.call(arguments); - var callback = args.pop(); - var key = hasher.apply(null, args); - if (key in memo) { - callback.apply(null, memo[key]); - } - else { - fn.apply(null, args.concat([function () { - memo[key] = arguments; - callback.apply(null, arguments); - }])); - } - }; - }; - -}()); http://git-wip-us.apache.org/repos/asf/incubator-cordova-blackberry-webworks/blob/2329a568/bin/node_modules/nodeunit/deps/console.log.js ---------------------------------------------------------------------- diff --git a/bin/node_modules/nodeunit/deps/console.log.js b/bin/node_modules/nodeunit/deps/console.log.js deleted file mode 100644 index fe146c1..0000000 --- a/bin/node_modules/nodeunit/deps/console.log.js +++ /dev/null @@ -1,55 +0,0 @@ -/* - A console.log that won't leave you hanging when node exits - 90% of this file was ripped from node.js - - License: see: https://github.com/joyent/node/blob/master/lib/console.js - */ - - // console object -var formatRegExp = /%[sdj]/g; -function format(f) { - var util = require('util'); - - if (typeof f !== 'string') { - var objects = []; - for (var i = 0; i < arguments.length; i++) { - objects.push(util.inspect(arguments[i])); - } - return objects.join(' '); - } - - - var i = 1; - var args = arguments; - var str = String(f).replace(formatRegExp, function(x) { - switch (x) { - case '%s': return String(args[i++]); - case '%d': return Number(args[i++]); - case '%j': return JSON.stringify(args[i++]); - default: - return x; - } - }); - for (var len = args.length, x = args[i]; i < len; x = args[++i]) { - if (x === null || typeof x !== 'object') { - str += ' ' + x; - } else { - str += ' ' + util.inspect(x); - } - } - return str; -} - -console.log = function() { - var res = process.stdout.write(format.apply(this, arguments) + '\n'); - - // this is the first time stdout got backed up - if (!res && !process.stdout.pendingWrite) { - process.stdout.pendingWrite = true; - - // magic sauce: keep node alive until stdout has flushed - process.stdout.once('drain', function () { - process.stdout.draining = false; - }); - } -}; http://git-wip-us.apache.org/repos/asf/incubator-cordova-blackberry-webworks/blob/2329a568/bin/node_modules/nodeunit/deps/ejs.js ---------------------------------------------------------------------- diff --git a/bin/node_modules/nodeunit/deps/ejs.js b/bin/node_modules/nodeunit/deps/ejs.js deleted file mode 100644 index f6abf29..0000000 --- a/bin/node_modules/nodeunit/deps/ejs.js +++ /dev/null @@ -1,125 +0,0 @@ - -/*! - * EJS - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var sys = require('sys'); - -/** - * Library version. - */ - -exports.version = '0.0.3'; - -/** - * Intermediate js cache. - * - * @type Object - */ - -var cache = {}; - -/** - * Clear intermediate js cache. - * - * @api public - */ - -exports.clearCache = function(){ - cache = {}; -}; - -/** - * Escape the given string of `html`. - * - * @param {String} html - * @return {String} - * @api private - */ - -function escape(html){ - return String(html) - .replace(/&(?!\w+;)/g, '&') - .replace(//g, '>') - .replace(/"/g, '"'); -} - -/** - * Parse the given `str` of ejs, returning the function body. - * - * @param {String} str - * @return {String} - * @api public - */ - -var parse = exports.parse = function(str){ - return 'var buf = [];\n' - + "with (locals) {\nbuf.push('" - + String(str) - .replace(/[\r\t]/g, " ") - .replace(/\n/g, "\\n") - .split("<%").join("\t") - .replace(/((^|%>)[^\t]*)'/g, "$1\r") - .replace(/\t=(.*?)%>/g, "', escape($1) ,'") - .replace(/\t-(.*?)%>/g, "', $1 ,'") - .split("\t").join("');") - .split("%>").join("buf.push('") - .split("\r").join("\\'") - + "');\n}\nreturn buf.join('');"; -}; - -/** - * Compile the given `str` of ejs into a `Function`. - * - * @param {String} str - * @param {Object} options - * @return {Function} - * @api public - */ - -var compile = exports.compile = function(str, options){ - if (options.debug) sys.puts(parse(str)); - return new Function('locals, escape', parse(str)); -}; - -/** - * Render the given `str` of ejs. - * - * Options: - * - * - `locals` Local variables object - * - `cache` Compiled functions are cached, requires `filename` - * - `filename` Used by `cache` to key caches - * - `context|scope` Function execution context - * - `debug` Output generated function body - * - * @param {String} str - * @param {Object} options - * @return {String} - * @api public - */ - -exports.render = function(str, options){ - var fn, - options = options || {}; - if (options.cache) { - if (options.filename) { - fn = cache[options.filename] = compile(str, options); - } else { - throw new Error('"cache" option requires "filename".'); - } - } else { - fn = compile(str, options); - } - return fn.call( - options.context || options.scope, - options.locals || {}, - escape); -}; \ No newline at end of file