Return-Path: X-Original-To: apmail-cordova-commits-archive@www.apache.org Delivered-To: apmail-cordova-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8BF5E10F05 for ; Sun, 13 Apr 2014 01:08:25 +0000 (UTC) Received: (qmail 74549 invoked by uid 500); 13 Apr 2014 01:08:10 -0000 Delivered-To: apmail-cordova-commits-archive@cordova.apache.org Received: (qmail 73596 invoked by uid 500); 13 Apr 2014 01:07:50 -0000 Mailing-List: contact commits-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cordova.apache.org Delivered-To: mailing list commits@cordova.apache.org Received: (qmail 73387 invoked by uid 99); 13 Apr 2014 01:07:46 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 13 Apr 2014 01:07:46 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 5E3B998C34D; Sun, 13 Apr 2014 01:07:45 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: bhiggins@apache.org To: commits@cordova.apache.org Date: Sun, 13 Apr 2014 01:08:24 -0000 Message-Id: <892c6fc1622f41caa03fbf31b1731cae@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [42/53] [abbrv] [partial] CB-6440 create - use shelljs rather than custom copy function http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/3016473f/blackberry10/node_modules/jasmine-node/lib/jasmine-node/requirejs-runner.js ---------------------------------------------------------------------- diff --git a/blackberry10/node_modules/jasmine-node/lib/jasmine-node/requirejs-runner.js b/blackberry10/node_modules/jasmine-node/lib/jasmine-node/requirejs-runner.js deleted file mode 100644 index bbaa08b..0000000 --- a/blackberry10/node_modules/jasmine-node/lib/jasmine-node/requirejs-runner.js +++ /dev/null @@ -1,87 +0,0 @@ -exports.executeJsRunner = function(specCollection, done, jasmineEnv, setupFile) { - var specs, - specLoader = require('./requirejs-spec-loader'), - requirejs = require('requirejs'), - vm = require('vm'), - fs = require('fs'), - coffeescript = require('coffee-script'), - template = fs.readFileSync( - setupFile || (__dirname + '/requirejs-wrapper-template.js'), - 'utf8' - ), - ensureUnixPath = function(path){ - return path.replace(/^(.):/, '/$1').replace(/\\/g, '/'); - }, - buildNewContext = function(spec){ - var context = { - describe: describe, - it: it, - xdescribe: xdescribe, - xit: xit, - beforeEach: beforeEach, - afterEach: afterEach, - spyOn: spyOn, - waitsFor: waitsFor, - waits: waits, - runs: runs, - jasmine: jasmine, - expect: expect, - require: require, - console: console, - process: process, - module: module, - specLoader: specLoader, - __dirname: spec.directory(), - __filename: spec.path(), - baseUrl: buildRelativeDirName(spec.directory()), - csPath: __dirname + '/cs' - }; - - context.global = context; - - return context; - }, - buildRelativeDirName = function(dir){ - var retVal = "", - thisDir = ensureUnixPath(process.cwd()), - toDir = ensureUnixPath(dir).split('/'), - index = 0; - - thisDir = thisDir.split('/'); - - for(; index < thisDir.length || index < toDir.length; index++) { - if(thisDir[index] != toDir[index]){ - for(var i = index; i < thisDir.length-1; i++){ - retVal += '../'; - } - - for(var i = index; i < toDir.length; i++){ - retVal += toDir[i] + '/'; - } - - break; - } - } - - return retVal.trim('/'); - }; - - specCollection.getSpecs().forEach(function(s){ - var script = fs.readFileSync(s.path(), 'utf8'), - wrappedScript; - - if (s.filename().substr(-6).toLowerCase() == 'coffee') { - script = coffeescript.compile(script); - } - - wrappedScript = template + script; - - var newContext = buildNewContext(s); - newContext.setTimeout = jasmine.getGlobal().setTimeout; - newContext.setInterval = jasmine.getGlobal().setInterval; - - vm.runInNewContext(wrappedScript, newContext, s.path()); - }); - - specLoader.executeWhenAllSpecsAreComplete(jasmineEnv); -}; http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/3016473f/blackberry10/node_modules/jasmine-node/lib/jasmine-node/requirejs-spec-loader.js ---------------------------------------------------------------------- diff --git a/blackberry10/node_modules/jasmine-node/lib/jasmine-node/requirejs-spec-loader.js b/blackberry10/node_modules/jasmine-node/lib/jasmine-node/requirejs-spec-loader.js deleted file mode 100644 index 284db7d..0000000 --- a/blackberry10/node_modules/jasmine-node/lib/jasmine-node/requirejs-spec-loader.js +++ /dev/null @@ -1,48 +0,0 @@ -var _ = require('underscore'), - registry = {}, - timeout = 120000, - now = function() { - return new Date().getTime(); - }, - loader = { - register: function(name) { - registry[name] = false; - }, - completed: function(name){ - registry[name] = true; - } - }, - specLoader = { - defineLoader: function(requirejs) { - requirejs.define('jasmine-spec-loader', function() { - return loader; - }); - }, - executeWhenAllSpecsAreComplete: function(jasmineEnv) { - var allComplete = false, - wait = now(), - timeoutCallback = function() { - allComplete = _.all(registry, function(value) { - return value; - }); - - if(!allComplete && wait + timeout > now()) { - setTimeout(timeoutCallback, 100); - } else if (!allComplete) { - console.log('Failed to load all specs within timeout window.'); - process.exit(-1); - } else { - jasmineEnv.execute(); - } - }; - - setTimeout(timeoutCallback, 100); - }, - setTimeoutInterval: function(value) { - timeout = value; - }, - }; - -for(var key in specLoader) { - exports[key] = specLoader[key]; -} http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/3016473f/blackberry10/node_modules/jasmine-node/lib/jasmine-node/requirejs-wrapper-template.js ---------------------------------------------------------------------- diff --git a/blackberry10/node_modules/jasmine-node/lib/jasmine-node/requirejs-wrapper-template.js b/blackberry10/node_modules/jasmine-node/lib/jasmine-node/requirejs-wrapper-template.js deleted file mode 100644 index 344daeb..0000000 --- a/blackberry10/node_modules/jasmine-node/lib/jasmine-node/requirejs-wrapper-template.js +++ /dev/null @@ -1,78 +0,0 @@ -/* Setup file run before spec files to setup the context (and RequireJS - * specifically) to execute the spec file. - * - * Defined by caller: - * - Jasmine predefines - * - require (Node require) - * - __dirname, __filename - * - baseUrl (Relative path to the directory containing this file) - * - csPath (Path to require-cs module) - * - * See requirejs-runner source for full invocation details. - */ -var define, - requirejsOrig = require('requirejs'), - ostring = Object.prototype.toString, - path = require('path'), - isArray = function(it){ - return ostring.call(it) === '[object Array]'; - }, - isFunction = function(it){ - return ostring.call(it) === '[object Function]'; - }, - requirejs = function(deps, callback){ - var retVal; - - if(!isArray(deps) && typeof deps !== 'string'){ - if(isArray(callback)){ - retVal = requirejsOrig(deps, callback, arguments[2]); - } else { - retVal = requirejsOrig(deps, [], callback); - } - } else { - retVal = requirejsOrig(deps, callback); - } - - return retVal; - }; - -requirejsOrig.config({ - baseUrl: baseUrl, - nodeRequire: require, - paths: { - cs: csPath - } -}); - -for(var key in requirejsOrig) { - requirejs[key] = requirejsOrig[key]; -} - -requirejs.config = function(config){ - var alteredConfig = {}; - - for(var key in config) { - alteredConfig[key] = config[key]; - } - - if(alteredConfig.baseUrl){ - var base = baseUrl.replace(/\\/g, '/'), - splitUrl = alteredConfig.baseUrl.replace(/\\/g, '/').split('/'), - index = 0; - - for(; index < splitUrl.length; index++){ - if(splitUrl[index] === '..'){ - base = path.dirname(base); - } else { - base += '/' + splitUrl[index]; - } - } - - alteredConfig.baseUrl = base; - } - - return requirejsOrig.config(alteredConfig); -}; - -require = requirejs; -define = requirejs.define; http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/3016473f/blackberry10/node_modules/jasmine-node/lib/jasmine-node/spec-collection.js ---------------------------------------------------------------------- diff --git a/blackberry10/node_modules/jasmine-node/lib/jasmine-node/spec-collection.js b/blackberry10/node_modules/jasmine-node/lib/jasmine-node/spec-collection.js deleted file mode 100644 index 4b2de89..0000000 --- a/blackberry10/node_modules/jasmine-node/lib/jasmine-node/spec-collection.js +++ /dev/null @@ -1,44 +0,0 @@ -var walkdir = require('walkdir'); -var path = require('path'); -var fs = require('fs'); -var specs; - -var createSpecObj = function(path, root) { - return { - path: function() { return path; }, - relativePath: function() { return path.replace(root, '').replace(/^[\/\\]/, '').replace(/\\/g, '/'); }, - directory: function() { return path.replace(/[\/\\][\s\w\.-]*$/, "").replace(/\\/g, '/'); }, - relativeDirectory: function() { return relativePath().replace(/[\/\\][\s\w\.-]*$/, "").replace(/\\/g, '/'); }, - filename: function() { return path.replace(/^.*[\\\/]/, ''); } - }; -}; - -exports.load = function(loadpaths, matcher) { - var wannaBeSpecs = [] - specs = []; - loadpaths.forEach(function(loadpath){ - wannaBeSpecs = walkdir.sync(loadpath, { follow_symlinks: true }); - for (var i = 0; i < wannaBeSpecs.length; i++) { - var file = wannaBeSpecs[i]; - try { - if (fs.statSync(file).isFile()) { - if (!/.*node_modules.*/.test(path.relative(loadpath, file)) & - matcher.test(path.basename(file))) { - specs.push(createSpecObj(file)); - } - } - } catch(e) { - // nothing to do here - } - } - }); -}; - -exports.getSpecs = function() { - // Sorts spec paths in ascending alphabetical order to be able to - // run tests in a deterministic order. - specs.sort(function(a, b) { - return a.path().localeCompare(b.path()); - }); - return specs; -}; http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/3016473f/blackberry10/node_modules/jasmine-node/node_modules/.bin/cake ---------------------------------------------------------------------- diff --git a/blackberry10/node_modules/jasmine-node/node_modules/.bin/cake b/blackberry10/node_modules/jasmine-node/node_modules/.bin/cake deleted file mode 120000 index d95f32a..0000000 --- a/blackberry10/node_modules/jasmine-node/node_modules/.bin/cake +++ /dev/null @@ -1 +0,0 @@ -../coffee-script/bin/cake \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/3016473f/blackberry10/node_modules/jasmine-node/node_modules/.bin/coffee ---------------------------------------------------------------------- diff --git a/blackberry10/node_modules/jasmine-node/node_modules/.bin/coffee b/blackberry10/node_modules/jasmine-node/node_modules/.bin/coffee deleted file mode 120000 index b57f275..0000000 --- a/blackberry10/node_modules/jasmine-node/node_modules/.bin/coffee +++ /dev/null @@ -1 +0,0 @@ -../coffee-script/bin/coffee \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/3016473f/blackberry10/node_modules/jasmine-node/node_modules/.bin/r.js ---------------------------------------------------------------------- diff --git a/blackberry10/node_modules/jasmine-node/node_modules/.bin/r.js b/blackberry10/node_modules/jasmine-node/node_modules/.bin/r.js deleted file mode 120000 index 2075b60..0000000 --- a/blackberry10/node_modules/jasmine-node/node_modules/.bin/r.js +++ /dev/null @@ -1 +0,0 @@ -../requirejs/bin/r.js \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/3016473f/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/.npmignore ---------------------------------------------------------------------- diff --git a/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/.npmignore b/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/.npmignore deleted file mode 100644 index 21e430d..0000000 --- a/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/.npmignore +++ /dev/null @@ -1,11 +0,0 @@ -*.coffee -*.html -.DS_Store -.git* -Cakefile -documentation/ -examples/ -extras/coffee-script.js -raw/ -src/ -test/ http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/3016473f/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/CNAME ---------------------------------------------------------------------- diff --git a/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/CNAME b/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/CNAME deleted file mode 100644 index faadabe..0000000 --- a/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/CNAME +++ /dev/null @@ -1 +0,0 @@ -coffeescript.org \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/3016473f/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/CONTRIBUTING.md ---------------------------------------------------------------------- diff --git a/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/CONTRIBUTING.md b/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/CONTRIBUTING.md deleted file mode 100644 index 6390c68..0000000 --- a/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/CONTRIBUTING.md +++ /dev/null @@ -1,9 +0,0 @@ -## How to contribute to CoffeeScript - -* Before you open a ticket or send a pull request, [search](https://github.com/jashkenas/coffee-script/issues) for previous discussions about the same feature or issue. Add to the earlier ticket if you find one. - -* Before sending a pull request for a feature, be sure to have [tests](https://github.com/jashkenas/coffee-script/tree/master/test). - -* Use the same coding style as the rest of the [codebase](https://github.com/jashkenas/coffee-script/tree/master/src). If you're just getting started with CoffeeScript, there's a nice [style guide](https://github.com/polarmobile/coffeescript-style-guide). - -* In your pull request, do not add documentation to `index.html` or re-build the minified `coffee-script.js` file. We'll do those things before cutting a new release. \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/3016473f/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/LICENSE ---------------------------------------------------------------------- diff --git a/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/LICENSE b/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/LICENSE deleted file mode 100644 index a396eae..0000000 --- a/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2009-2013 Jeremy Ashkenas - -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/cordova-blackberry/blob/3016473f/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/README ---------------------------------------------------------------------- diff --git a/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/README b/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/README deleted file mode 100644 index 69ee6f4..0000000 --- a/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/README +++ /dev/null @@ -1,51 +0,0 @@ - - { - } } { - { { } } - } }{ { - { }{ } } _____ __ __ - ( }{ }{ { ) / ____| / _|/ _| - .- { { } { }} -. | | ___ | |_| |_ ___ ___ - ( ( } { } { } } ) | | / _ \| _| _/ _ \/ _ \ - |`-..________ ..-'| | |___| (_) | | | || __/ __/ - | | \_____\___/|_| |_| \___|\___| - | ;--. - | (__ \ _____ _ _ - | | ) ) / ____| (_) | | - | |/ / | (___ ___ _ __ _ _ __ | |_ - | ( / \___ \ / __| '__| | '_ \| __| - | |/ ____) | (__| | | | |_) | |_ - | | |_____/ \___|_| |_| .__/ \__| - `-.._________..-' | | - |_| - - - CoffeeScript is a little language that compiles into JavaScript. - - Install Node.js, and then the CoffeeScript compiler: - sudo bin/cake install - - Or, if you have the Node Package Manager installed: - npm install -g coffee-script - (Leave off the -g if you don't wish to install globally.) - - Execute a script: - coffee /path/to/script.coffee - - Compile a script: - coffee -c /path/to/script.coffee - - For documentation, usage, and examples, see: - http://coffeescript.org/ - - To suggest a feature, report a bug, or general discussion: - http://github.com/jashkenas/coffee-script/issues/ - - If you'd like to chat, drop by #coffeescript on Freenode IRC, - or on webchat.freenode.net. - - The source repository: - git://github.com/jashkenas/coffee-script.git - - All contributors are listed here: - http://github.com/jashkenas/coffee-script/contributors http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/3016473f/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/Rakefile ---------------------------------------------------------------------- diff --git a/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/Rakefile b/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/Rakefile deleted file mode 100644 index d90cce3..0000000 --- a/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/Rakefile +++ /dev/null @@ -1,79 +0,0 @@ -require 'rubygems' -require 'erb' -require 'fileutils' -require 'rake/testtask' -require 'json' - -desc "Build the documentation page" -task :doc do - source = 'documentation/index.html.erb' - child = fork { exec "bin/coffee -bcw -o documentation/js documentation/coffee/*.coffee" } - at_exit { Process.kill("INT", child) } - Signal.trap("INT") { exit } - loop do - mtime = File.stat(source).mtime - if !@mtime || mtime > @mtime - rendered = ERB.new(File.read(source)).result(binding) - File.open('index.html', 'w+') {|f| f.write(rendered) } - end - @mtime = mtime - sleep 1 - end -end - -desc "Build coffee-script-source gem" -task :gem do - require 'rubygems' - require 'rubygems/package' - - gemspec = Gem::Specification.new do |s| - s.name = 'coffee-script-source' - s.version = JSON.parse(File.read('package.json'))["version"] - s.date = Time.now.strftime("%Y-%m-%d") - - s.homepage = "http://jashkenas.github.com/coffee-script/" - s.summary = "The CoffeeScript Compiler" - s.description = <<-EOS - CoffeeScript is a little language that compiles into JavaScript. - Underneath all of those embarrassing braces and semicolons, - JavaScript has always had a gorgeous object model at its heart. - CoffeeScript is an attempt to expose the good parts of JavaScript - in a simple way. - EOS - - s.files = [ - 'lib/coffee_script/coffee-script.js', - 'lib/coffee_script/source.rb' - ] - - s.authors = ['Jeremy Ashkenas'] - s.email = 'jashkenas@gmail.com' - s.rubyforge_project = 'coffee-script-source' - s.license = "MIT" - end - - file = File.open("coffee-script-source.gem", "w") - Gem::Package.open(file, 'w') do |pkg| - pkg.metadata = gemspec.to_yaml - - path = "lib/coffee_script/source.rb" - contents = <<-ERUBY -module CoffeeScript - module Source - def self.bundled_path - File.expand_path("../coffee-script.js", __FILE__) - end - end -end - ERUBY - pkg.add_file_simple(path, 0644, contents.size) do |tar_io| - tar_io.write(contents) - end - - contents = File.read("extras/coffee-script.js") - path = "lib/coffee_script/coffee-script.js" - pkg.add_file_simple(path, 0644, contents.size) do |tar_io| - tar_io.write(contents) - end - end -end http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/3016473f/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/bin/cake ---------------------------------------------------------------------- diff --git a/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/bin/cake b/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/bin/cake deleted file mode 100755 index 5965f4e..0000000 --- a/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/bin/cake +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env node - -var path = require('path'); -var fs = require('fs'); -var lib = path.join(path.dirname(fs.realpathSync(__filename)), '../lib'); - -require(lib + '/coffee-script/cake').run(); http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/3016473f/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/bin/coffee ---------------------------------------------------------------------- diff --git a/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/bin/coffee b/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/bin/coffee deleted file mode 100755 index 3d1d71c..0000000 --- a/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/bin/coffee +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env node - -var path = require('path'); -var fs = require('fs'); -var lib = path.join(path.dirname(fs.realpathSync(__filename)), '../lib'); - -require(lib + '/coffee-script/command').run(); http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/3016473f/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/browser.js ---------------------------------------------------------------------- diff --git a/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/browser.js b/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/browser.js deleted file mode 100644 index e5411d8..0000000 --- a/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/browser.js +++ /dev/null @@ -1,118 +0,0 @@ -// Generated by CoffeeScript 1.6.3 -(function() { - var CoffeeScript, compile, runScripts, - __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; - - CoffeeScript = require('./coffee-script'); - - CoffeeScript.require = require; - - compile = CoffeeScript.compile; - - CoffeeScript["eval"] = function(code, options) { - if (options == null) { - options = {}; - } - if (options.bare == null) { - options.bare = true; - } - return eval(compile(code, options)); - }; - - CoffeeScript.run = function(code, options) { - if (options == null) { - options = {}; - } - options.bare = true; - options.shiftLine = true; - return Function(compile(code, options))(); - }; - - if (typeof window === "undefined" || window === null) { - return; - } - - if ((typeof btoa !== "undefined" && btoa !== null) && (typeof JSON !== "undefined" && JSON !== null) && (typeof unescape !== "undefined" && unescape !== null) && (typeof encodeURIComponent !== "undefined" && encodeURIComponent !== null)) { - compile = function(code, options) { - var js, v3SourceMap, _ref; - if (options == null) { - options = {}; - } - options.sourceMap = true; - options.inline = true; - _ref = CoffeeScript.compile(code, options), js = _ref.js, v3SourceMap = _ref.v3SourceMap; - return "" + js + "\n//@ sourceMappingURL=data:application/json;base64," + (btoa(unescape(encodeURIComponent(v3SourceMap)))) + "\n//@ sourceURL=coffeescript"; - }; - } - - CoffeeScript.load = function(url, callback, options) { - var xhr; - if (options == null) { - options = {}; - } - options.sourceFiles = [url]; - xhr = window.ActiveXObject ? new window.ActiveXObject('Microsoft.XMLHTTP') : new window.XMLHttpRequest(); - xhr.open('GET', url, true); - if ('overrideMimeType' in xhr) { - xhr.overrideMimeType('text/plain'); - } - xhr.onreadystatechange = function() { - var _ref; - if (xhr.readyState === 4) { - if ((_ref = xhr.status) === 0 || _ref === 200) { - CoffeeScript.run(xhr.responseText, options); - } else { - throw new Error("Could not load " + url); - } - if (callback) { - return callback(); - } - } - }; - return xhr.send(null); - }; - - runScripts = function() { - var coffees, coffeetypes, execute, index, length, s, scripts; - scripts = window.document.getElementsByTagName('script'); - coffeetypes = ['text/coffeescript', 'text/literate-coffeescript']; - coffees = (function() { - var _i, _len, _ref, _results; - _results = []; - for (_i = 0, _len = scripts.length; _i < _len; _i++) { - s = scripts[_i]; - if (_ref = s.type, __indexOf.call(coffeetypes, _ref) >= 0) { - _results.push(s); - } - } - return _results; - })(); - index = 0; - length = coffees.length; - (execute = function() { - var mediatype, options, script; - script = coffees[index++]; - mediatype = script != null ? script.type : void 0; - if (__indexOf.call(coffeetypes, mediatype) >= 0) { - options = { - literate: mediatype === 'text/literate-coffeescript' - }; - if (script.src) { - return CoffeeScript.load(script.src, execute, options); - } else { - options.sourceFiles = ['embedded']; - CoffeeScript.run(script.innerHTML, options); - return execute(); - } - } - })(); - return null; - }; - - if (window.addEventListener) { - window.addEventListener('DOMContentLoaded', runScripts, false); - } else { - window.attachEvent('onload', runScripts); - } - -}).call(this); http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/3016473f/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/cake.js ---------------------------------------------------------------------- diff --git a/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/cake.js b/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/cake.js deleted file mode 100644 index 68bd7c3..0000000 --- a/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/cake.js +++ /dev/null @@ -1,114 +0,0 @@ -// Generated by CoffeeScript 1.6.3 -(function() { - var CoffeeScript, cakefileDirectory, existsSync, fatalError, fs, helpers, missingTask, oparse, options, optparse, path, printTasks, switches, tasks; - - fs = require('fs'); - - path = require('path'); - - helpers = require('./helpers'); - - optparse = require('./optparse'); - - CoffeeScript = require('./coffee-script'); - - existsSync = fs.existsSync || path.existsSync; - - tasks = {}; - - options = {}; - - switches = []; - - oparse = null; - - helpers.extend(global, { - task: function(name, description, action) { - var _ref; - if (!action) { - _ref = [description, action], action = _ref[0], description = _ref[1]; - } - return tasks[name] = { - name: name, - description: description, - action: action - }; - }, - option: function(letter, flag, description) { - return switches.push([letter, flag, description]); - }, - invoke: function(name) { - if (!tasks[name]) { - missingTask(name); - } - return tasks[name].action(options); - } - }); - - exports.run = function() { - var arg, args, e, _i, _len, _ref, _results; - global.__originalDirname = fs.realpathSync('.'); - process.chdir(cakefileDirectory(__originalDirname)); - args = process.argv.slice(2); - CoffeeScript.run(fs.readFileSync('Cakefile').toString(), { - filename: 'Cakefile' - }); - oparse = new optparse.OptionParser(switches); - if (!args.length) { - return printTasks(); - } - try { - options = oparse.parse(args); - } catch (_error) { - e = _error; - return fatalError("" + e); - } - _ref = options["arguments"]; - _results = []; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - arg = _ref[_i]; - _results.push(invoke(arg)); - } - return _results; - }; - - printTasks = function() { - var cakefilePath, desc, name, relative, spaces, task; - relative = path.relative || path.resolve; - cakefilePath = path.join(relative(__originalDirname, process.cwd()), 'Cakefile'); - console.log("" + cakefilePath + " defines the following tasks:\n"); - for (name in tasks) { - task = tasks[name]; - spaces = 20 - name.length; - spaces = spaces > 0 ? Array(spaces + 1).join(' ') : ''; - desc = task.description ? "# " + task.description : ''; - console.log("cake " + name + spaces + " " + desc); - } - if (switches.length) { - return console.log(oparse.help()); - } - }; - - fatalError = function(message) { - console.error(message + '\n'); - console.log('To see a list of all tasks/options, run "cake"'); - return process.exit(1); - }; - - missingTask = function(task) { - return fatalError("No such task: " + task); - }; - - cakefileDirectory = function(dir) { - var parent; - if (existsSync(path.join(dir, 'Cakefile'))) { - return dir; - } - parent = path.normalize(path.join(dir, '..')); - if (parent !== dir) { - return cakefileDirectory(parent); - } - throw new Error("Cakefile not found in " + (process.cwd())); - }; - -}).call(this); http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/3016473f/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/coffee-script.js ---------------------------------------------------------------------- diff --git a/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/coffee-script.js b/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/coffee-script.js deleted file mode 100644 index 11ccd81..0000000 --- a/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/coffee-script.js +++ /dev/null @@ -1,358 +0,0 @@ -// Generated by CoffeeScript 1.6.3 -(function() { - var Lexer, Module, SourceMap, child_process, compile, ext, findExtension, fork, formatSourcePosition, fs, helpers, lexer, loadFile, parser, patchStackTrace, patched, path, sourceMaps, vm, _i, _len, _ref, - __hasProp = {}.hasOwnProperty; - - fs = require('fs'); - - vm = require('vm'); - - path = require('path'); - - child_process = require('child_process'); - - Lexer = require('./lexer').Lexer; - - parser = require('./parser').parser; - - helpers = require('./helpers'); - - SourceMap = require('./sourcemap'); - - exports.VERSION = '1.6.3'; - - exports.helpers = helpers; - - exports.compile = compile = function(code, options) { - var answer, currentColumn, currentLine, fragment, fragments, header, js, map, merge, newLines, _i, _len; - if (options == null) { - options = {}; - } - merge = helpers.merge; - if (options.sourceMap) { - map = new SourceMap; - } - fragments = parser.parse(lexer.tokenize(code, options)).compileToFragments(options); - currentLine = 0; - if (options.header) { - currentLine += 1; - } - if (options.shiftLine) { - currentLine += 1; - } - currentColumn = 0; - js = ""; - for (_i = 0, _len = fragments.length; _i < _len; _i++) { - fragment = fragments[_i]; - if (options.sourceMap) { - if (fragment.locationData) { - map.add([fragment.locationData.first_line, fragment.locationData.first_column], [currentLine, currentColumn], { - noReplace: true - }); - } - newLines = helpers.count(fragment.code, "\n"); - currentLine += newLines; - currentColumn = fragment.code.length - (newLines ? fragment.code.lastIndexOf("\n") : 0); - } - js += fragment.code; - } - if (options.header) { - header = "Generated by CoffeeScript " + this.VERSION; - js = "// " + header + "\n" + js; - } - if (options.sourceMap) { - answer = { - js: js - }; - answer.sourceMap = map; - answer.v3SourceMap = map.generate(options, code); - return answer; - } else { - return js; - } - }; - - exports.tokens = function(code, options) { - return lexer.tokenize(code, options); - }; - - exports.nodes = function(source, options) { - if (typeof source === 'string') { - return parser.parse(lexer.tokenize(source, options)); - } else { - return parser.parse(source); - } - }; - - exports.run = function(code, options) { - var answer, mainModule; - if (options == null) { - options = {}; - } - mainModule = require.main; - if (options.sourceMap == null) { - options.sourceMap = true; - } - mainModule.filename = process.argv[1] = options.filename ? fs.realpathSync(options.filename) : '.'; - mainModule.moduleCache && (mainModule.moduleCache = {}); - mainModule.paths = require('module')._nodeModulePaths(path.dirname(fs.realpathSync(options.filename || '.'))); - if (!helpers.isCoffee(mainModule.filename) || require.extensions) { - answer = compile(code, options); - patchStackTrace(); - sourceMaps[mainModule.filename] = answer.sourceMap; - return mainModule._compile(answer.js, mainModule.filename); - } else { - return mainModule._compile(code, mainModule.filename); - } - }; - - exports["eval"] = function(code, options) { - var Module, Script, js, k, o, r, sandbox, v, _i, _len, _module, _ref, _ref1, _require; - if (options == null) { - options = {}; - } - if (!(code = code.trim())) { - return; - } - Script = vm.Script; - if (Script) { - if (options.sandbox != null) { - if (options.sandbox instanceof Script.createContext().constructor) { - sandbox = options.sandbox; - } else { - sandbox = Script.createContext(); - _ref = options.sandbox; - for (k in _ref) { - if (!__hasProp.call(_ref, k)) continue; - v = _ref[k]; - sandbox[k] = v; - } - } - sandbox.global = sandbox.root = sandbox.GLOBAL = sandbox; - } else { - sandbox = global; - } - sandbox.__filename = options.filename || 'eval'; - sandbox.__dirname = path.dirname(sandbox.__filename); - if (!(sandbox !== global || sandbox.module || sandbox.require)) { - Module = require('module'); - sandbox.module = _module = new Module(options.modulename || 'eval'); - sandbox.require = _require = function(path) { - return Module._load(path, _module, true); - }; - _module.filename = sandbox.__filename; - _ref1 = Object.getOwnPropertyNames(require); - for (_i = 0, _len = _ref1.length; _i < _len; _i++) { - r = _ref1[_i]; - if (r !== 'paths') { - _require[r] = require[r]; - } - } - _require.paths = _module.paths = Module._nodeModulePaths(process.cwd()); - _require.resolve = function(request) { - return Module._resolveFilename(request, _module); - }; - } - } - o = {}; - for (k in options) { - if (!__hasProp.call(options, k)) continue; - v = options[k]; - o[k] = v; - } - o.bare = true; - js = compile(code, o); - if (sandbox === global) { - return vm.runInThisContext(js); - } else { - return vm.runInContext(js, sandbox); - } - }; - - loadFile = function(module, filename) { - var answer, raw, stripped; - raw = fs.readFileSync(filename, 'utf8'); - stripped = raw.charCodeAt(0) === 0xFEFF ? raw.substring(1) : raw; - answer = compile(stripped, { - filename: filename, - sourceMap: true, - literate: helpers.isLiterate(filename) - }); - sourceMaps[filename] = answer.sourceMap; - return module._compile(answer.js, filename); - }; - - if (require.extensions) { - _ref = ['.coffee', '.litcoffee', '.coffee.md']; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - ext = _ref[_i]; - require.extensions[ext] = loadFile; - } - Module = require('module'); - findExtension = function(filename) { - var curExtension, extensions; - extensions = path.basename(filename).split('.'); - if (extensions[0] === '') { - extensions.shift(); - } - while (extensions.shift()) { - curExtension = '.' + extensions.join('.'); - if (Module._extensions[curExtension]) { - return curExtension; - } - } - return '.js'; - }; - Module.prototype.load = function(filename) { - var extension; - this.filename = filename; - this.paths = Module._nodeModulePaths(path.dirname(filename)); - extension = findExtension(filename); - Module._extensions[extension](this, filename); - return this.loaded = true; - }; - } - - if (child_process) { - fork = child_process.fork; - child_process.fork = function(path, args, options) { - var execPath; - if (args == null) { - args = []; - } - if (options == null) { - options = {}; - } - execPath = helpers.isCoffee(path) ? 'coffee' : null; - if (!Array.isArray(args)) { - args = []; - options = args || {}; - } - options.execPath || (options.execPath = execPath); - return fork(path, args, options); - }; - } - - lexer = new Lexer; - - parser.lexer = { - lex: function() { - var tag, token; - token = this.tokens[this.pos++]; - if (token) { - tag = token[0], this.yytext = token[1], this.yylloc = token[2]; - this.yylineno = this.yylloc.first_line; - } else { - tag = ''; - } - return tag; - }, - setInput: function(tokens) { - this.tokens = tokens; - return this.pos = 0; - }, - upcomingInput: function() { - return ""; - } - }; - - parser.yy = require('./nodes'); - - parser.yy.parseError = function(message, _arg) { - var token; - token = _arg.token; - message = "unexpected " + (token === 1 ? 'end of input' : token); - return helpers.throwSyntaxError(message, parser.lexer.yylloc); - }; - - patched = false; - - sourceMaps = {}; - - patchStackTrace = function() { - var mainModule; - if (patched) { - return; - } - patched = true; - mainModule = require.main; - return Error.prepareStackTrace = function(err, stack) { - var frame, frames, getSourceMapping, sourceFiles, _ref1; - sourceFiles = {}; - getSourceMapping = function(filename, line, column) { - var answer, sourceMap; - sourceMap = sourceMaps[filename]; - if (sourceMap) { - answer = sourceMap.sourceLocation([line - 1, column - 1]); - } - if (answer) { - return [answer[0] + 1, answer[1] + 1]; - } else { - return null; - } - }; - frames = (function() { - var _j, _len1, _results; - _results = []; - for (_j = 0, _len1 = stack.length; _j < _len1; _j++) { - frame = stack[_j]; - if (frame.getFunction() === exports.run) { - break; - } - _results.push(" at " + (formatSourcePosition(frame, getSourceMapping))); - } - return _results; - })(); - return "" + err.name + ": " + ((_ref1 = err.message) != null ? _ref1 : '') + "\n" + (frames.join('\n')) + "\n"; - }; - }; - - formatSourcePosition = function(frame, getSourceMapping) { - var as, column, fileLocation, fileName, functionName, isConstructor, isMethodCall, line, methodName, source, tp, typeName; - fileName = void 0; - fileLocation = ''; - if (frame.isNative()) { - fileLocation = "native"; - } else { - if (frame.isEval()) { - fileName = frame.getScriptNameOrSourceURL(); - if (!fileName) { - fileLocation = "" + (frame.getEvalOrigin()) + ", "; - } - } else { - fileName = frame.getFileName(); - } - fileName || (fileName = ""); - line = frame.getLineNumber(); - column = frame.getColumnNumber(); - source = getSourceMapping(fileName, line, column); - fileLocation = source ? "" + fileName + ":" + source[0] + ":" + source[1] + ", :" + line + ":" + column : "" + fileName + ":" + line + ":" + column; - } - functionName = frame.getFunctionName(); - isConstructor = frame.isConstructor(); - isMethodCall = !(frame.isToplevel() || isConstructor); - if (isMethodCall) { - methodName = frame.getMethodName(); - typeName = frame.getTypeName(); - if (functionName) { - tp = as = ''; - if (typeName && functionName.indexOf(typeName)) { - tp = "" + typeName + "."; - } - if (methodName && functionName.indexOf("." + methodName) !== functionName.length - methodName.length - 1) { - as = " [as " + methodName + "]"; - } - return "" + tp + functionName + as + " (" + fileLocation + ")"; - } else { - return "" + typeName + "." + (methodName || '') + " (" + fileLocation + ")"; - } - } else if (isConstructor) { - return "new " + (functionName || '') + " (" + fileLocation + ")"; - } else if (functionName) { - return "" + functionName + " (" + fileLocation + ")"; - } else { - return fileLocation; - } - }; - -}).call(this); http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/3016473f/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/command.js ---------------------------------------------------------------------- diff --git a/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/command.js b/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/command.js deleted file mode 100644 index 26b2554..0000000 --- a/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/command.js +++ /dev/null @@ -1,526 +0,0 @@ -// Generated by CoffeeScript 1.6.3 -(function() { - var BANNER, CoffeeScript, EventEmitter, SWITCHES, compileJoin, compileOptions, compilePath, compileScript, compileStdio, exec, exists, forkNode, fs, helpers, hidden, joinTimeout, notSources, optionParser, optparse, opts, outputPath, parseOptions, path, printLine, printTokens, printWarn, removeSource, sourceCode, sources, spawn, timeLog, unwatchDir, usage, useWinPathSep, version, wait, watch, watchDir, watchers, writeJs, _ref; - - fs = require('fs'); - - path = require('path'); - - helpers = require('./helpers'); - - optparse = require('./optparse'); - - CoffeeScript = require('./coffee-script'); - - _ref = require('child_process'), spawn = _ref.spawn, exec = _ref.exec; - - EventEmitter = require('events').EventEmitter; - - exists = fs.exists || path.exists; - - useWinPathSep = path.sep === '\\'; - - helpers.extend(CoffeeScript, new EventEmitter); - - printLine = function(line) { - return process.stdout.write(line + '\n'); - }; - - printWarn = function(line) { - return process.stderr.write(line + '\n'); - }; - - hidden = function(file) { - return /^\.|~$/.test(file); - }; - - BANNER = 'Usage: coffee [options] path/to/script.coffee -- [args]\n\nIf called without options, `coffee` will run your script.'; - - SWITCHES = [['-b', '--bare', 'compile without a top-level function wrapper'], ['-c', '--compile', 'compile to JavaScript and save as .js files'], ['-e', '--eval', 'pass a string from the command line as input'], ['-h', '--help', 'display this help message'], ['-i', '--interactive', 'run an interactive CoffeeScript REPL'], ['-j', '--join [FILE]', 'concatenate the source CoffeeScript before compiling'], ['-m', '--map', 'generate source map and save as .map files'], ['-n', '--nodes', 'print out the parse tree that the parser produces'], ['--nodejs [ARGS]', 'pass options directly to the "node" binary'], ['-o', '--output [DIR]', 'set the output directory for compiled JavaScript'], ['-p', '--print', 'print out the compiled JavaScript'], ['-s', '--stdio', 'listen for and compile scripts over stdio'], ['-l', '--literate', 'treat stdio as literate style coffee-script'], ['-t', '--tokens', 'print out the tokens that the lexer/rewriter produce'], ['-v', '--version', 'display the version numb er'], ['-w', '--watch', 'watch scripts for changes and rerun commands']]; - - opts = {}; - - sources = []; - - sourceCode = []; - - notSources = {}; - - watchers = {}; - - optionParser = null; - - exports.run = function() { - var literals, source, _i, _len, _results; - parseOptions(); - if (opts.nodejs) { - return forkNode(); - } - if (opts.help) { - return usage(); - } - if (opts.version) { - return version(); - } - if (opts.interactive) { - return require('./repl').start(); - } - if (opts.watch && !fs.watch) { - return printWarn("The --watch feature depends on Node v0.6.0+. You are running " + process.version + "."); - } - if (opts.stdio) { - return compileStdio(); - } - if (opts["eval"]) { - return compileScript(null, sources[0]); - } - if (!sources.length) { - return require('./repl').start(); - } - literals = opts.run ? sources.splice(1) : []; - process.argv = process.argv.slice(0, 2).concat(literals); - process.argv[0] = 'coffee'; - _results = []; - for (_i = 0, _len = sources.length; _i < _len; _i++) { - source = sources[_i]; - _results.push(compilePath(source, true, path.normalize(source))); - } - return _results; - }; - - compilePath = function(source, topLevel, base) { - return fs.stat(source, function(err, stats) { - if (err && err.code !== 'ENOENT') { - throw err; - } - if ((err != null ? err.code : void 0) === 'ENOENT') { - console.error("File not found: " + source); - process.exit(1); - } - if (stats.isDirectory() && path.dirname(source) !== 'node_modules') { - if (opts.watch) { - watchDir(source, base); - } - return fs.readdir(source, function(err, files) { - var file, index, _ref1, _ref2; - if (err && err.code !== 'ENOENT') { - throw err; - } - if ((err != null ? err.code : void 0) === 'ENOENT') { - return; - } - index = sources.indexOf(source); - files = files.filter(function(file) { - return !hidden(file); - }); - [].splice.apply(sources, [index, index - index + 1].concat(_ref1 = (function() { - var _i, _len, _results; - _results = []; - for (_i = 0, _len = files.length; _i < _len; _i++) { - file = files[_i]; - _results.push(path.join(source, file)); - } - return _results; - })())), _ref1; - [].splice.apply(sourceCode, [index, index - index + 1].concat(_ref2 = files.map(function() { - return null; - }))), _ref2; - return files.forEach(function(file) { - return compilePath(path.join(source, file), false, base); - }); - }); - } else if (topLevel || helpers.isCoffee(source)) { - if (opts.watch) { - watch(source, base); - } - return fs.readFile(source, function(err, code) { - if (err && err.code !== 'ENOENT') { - throw err; - } - if ((err != null ? err.code : void 0) === 'ENOENT') { - return; - } - return compileScript(source, code.toString(), base); - }); - } else { - notSources[source] = true; - return removeSource(source, base); - } - }); - }; - - compileScript = function(file, input, base) { - var compiled, err, message, o, options, t, task, useColors; - if (base == null) { - base = null; - } - o = opts; - options = compileOptions(file, base); - try { - t = task = { - file: file, - input: input, - options: options - }; - CoffeeScript.emit('compile', task); - if (o.tokens) { - return printTokens(CoffeeScript.tokens(t.input, t.options)); - } else if (o.nodes) { - return printLine(CoffeeScript.nodes(t.input, t.options).toString().trim()); - } else if (o.run) { - return CoffeeScript.run(t.input, t.options); - } else if (o.join && t.file !== o.join) { - if (helpers.isLiterate(file)) { - t.input = helpers.invertLiterate(t.input); - } - sourceCode[sources.indexOf(t.file)] = t.input; - return compileJoin(); - } else { - compiled = CoffeeScript.compile(t.input, t.options); - t.output = compiled; - if (o.map) { - t.output = compiled.js; - t.sourceMap = compiled.v3SourceMap; - } - CoffeeScript.emit('success', task); - if (o.print) { - return printLine(t.output.trim()); - } else if (o.compile || o.map) { - return writeJs(base, t.file, t.output, options.jsPath, t.sourceMap); - } - } - } catch (_error) { - err = _error; - CoffeeScript.emit('failure', err, task); - if (CoffeeScript.listeners('failure').length) { - return; - } - useColors = process.stdout.isTTY && !process.env.NODE_DISABLE_COLORS; - message = helpers.prettyErrorMessage(err, file || '[stdin]', input, useColors); - if (o.watch) { - return printLine(message + '\x07'); - } else { - printWarn(message); - return process.exit(1); - } - } - }; - - compileStdio = function() { - var code, stdin; - code = ''; - stdin = process.openStdin(); - stdin.on('data', function(buffer) { - if (buffer) { - return code += buffer.toString(); - } - }); - return stdin.on('end', function() { - return compileScript(null, code); - }); - }; - - joinTimeout = null; - - compileJoin = function() { - if (!opts.join) { - return; - } - if (!sourceCode.some(function(code) { - return code === null; - })) { - clearTimeout(joinTimeout); - return joinTimeout = wait(100, function() { - return compileScript(opts.join, sourceCode.join('\n'), opts.join); - }); - } - }; - - watch = function(source, base) { - var compile, compileTimeout, e, prevStats, rewatch, watchErr, watcher; - prevStats = null; - compileTimeout = null; - watchErr = function(e) { - if (e.code === 'ENOENT') { - if (sources.indexOf(source) === -1) { - return; - } - try { - rewatch(); - return compile(); - } catch (_error) { - e = _error; - removeSource(source, base, true); - return compileJoin(); - } - } else { - throw e; - } - }; - compile = function() { - clearTimeout(compileTimeout); - return compileTimeout = wait(25, function() { - return fs.stat(source, function(err, stats) { - if (err) { - return watchErr(err); - } - if (prevStats && stats.size === prevStats.size && stats.mtime.getTime() === prevStats.mtime.getTime()) { - return rewatch(); - } - prevStats = stats; - return fs.readFile(source, function(err, code) { - if (err) { - return watchErr(err); - } - compileScript(source, code.toString(), base); - return rewatch(); - }); - }); - }); - }; - try { - watcher = fs.watch(source, compile); - } catch (_error) { - e = _error; - watchErr(e); - } - return rewatch = function() { - if (watcher != null) { - watcher.close(); - } - return watcher = fs.watch(source, compile); - }; - }; - - watchDir = function(source, base) { - var e, readdirTimeout, watcher; - readdirTimeout = null; - try { - return watcher = fs.watch(source, function() { - clearTimeout(readdirTimeout); - return readdirTimeout = wait(25, function() { - return fs.readdir(source, function(err, files) { - var file, _i, _len, _results; - if (err) { - if (err.code !== 'ENOENT') { - throw err; - } - watcher.close(); - return unwatchDir(source, base); - } - _results = []; - for (_i = 0, _len = files.length; _i < _len; _i++) { - file = files[_i]; - if (!(!hidden(file) && !notSources[file])) { - continue; - } - file = path.join(source, file); - if (sources.some(function(s) { - return s.indexOf(file) >= 0; - })) { - continue; - } - sources.push(file); - sourceCode.push(null); - _results.push(compilePath(file, false, base)); - } - return _results; - }); - }); - }); - } catch (_error) { - e = _error; - if (e.code !== 'ENOENT') { - throw e; - } - } - }; - - unwatchDir = function(source, base) { - var file, prevSources, toRemove, _i, _len; - prevSources = sources.slice(0); - toRemove = (function() { - var _i, _len, _results; - _results = []; - for (_i = 0, _len = sources.length; _i < _len; _i++) { - file = sources[_i]; - if (file.indexOf(source) >= 0) { - _results.push(file); - } - } - return _results; - })(); - for (_i = 0, _len = toRemove.length; _i < _len; _i++) { - file = toRemove[_i]; - removeSource(file, base, true); - } - if (!sources.some(function(s, i) { - return prevSources[i] !== s; - })) { - return; - } - return compileJoin(); - }; - - removeSource = function(source, base, removeJs) { - var index, jsPath; - index = sources.indexOf(source); - sources.splice(index, 1); - sourceCode.splice(index, 1); - if (removeJs && !opts.join) { - jsPath = outputPath(source, base); - return exists(jsPath, function(itExists) { - if (itExists) { - return fs.unlink(jsPath, function(err) { - if (err && err.code !== 'ENOENT') { - throw err; - } - return timeLog("removed " + source); - }); - } - }); - } - }; - - outputPath = function(source, base, extension) { - var baseDir, basename, dir, srcDir; - if (extension == null) { - extension = ".js"; - } - basename = helpers.baseFileName(source, true, useWinPathSep); - srcDir = path.dirname(source); - baseDir = base === '.' ? srcDir : srcDir.substring(base.length); - dir = opts.output ? path.join(opts.output, baseDir) : srcDir; - return path.join(dir, basename + extension); - }; - - writeJs = function(base, sourcePath, js, jsPath, generatedSourceMap) { - var compile, jsDir, sourceMapPath; - if (generatedSourceMap == null) { - generatedSourceMap = null; - } - sourceMapPath = outputPath(sourcePath, base, ".map"); - jsDir = path.dirname(jsPath); - compile = function() { - if (opts.compile) { - if (js.length <= 0) { - js = ' '; - } - if (generatedSourceMap) { - js = "" + js + "\n/*\n//@ sourceMappingURL=" + (helpers.baseFileName(sourceMapPath, false, useWinPathSep)) + "\n*/\n"; - } - fs.writeFile(jsPath, js, function(err) { - if (err) { - return printLine(err.message); - } else if (opts.compile && opts.watch) { - return timeLog("compiled " + sourcePath); - } - }); - } - if (generatedSourceMap) { - return fs.writeFile(sourceMapPath, generatedSourceMap, function(err) { - if (err) { - return printLine("Could not write source map: " + err.message); - } - }); - } - }; - return exists(jsDir, function(itExists) { - if (itExists) { - return compile(); - } else { - return exec("mkdir -p " + jsDir, compile); - } - }); - }; - - wait = function(milliseconds, func) { - return setTimeout(func, milliseconds); - }; - - timeLog = function(message) { - return console.log("" + ((new Date).toLocaleTimeString()) + " - " + message); - }; - - printTokens = function(tokens) { - var strings, tag, token, value; - strings = (function() { - var _i, _len, _results; - _results = []; - for (_i = 0, _len = tokens.length; _i < _len; _i++) { - token = tokens[_i]; - tag = token[0]; - value = token[1].toString().replace(/\n/, '\\n'); - _results.push("[" + tag + " " + value + "]"); - } - return _results; - })(); - return printLine(strings.join(' ')); - }; - - parseOptions = function() { - var i, o, source, _i, _len; - optionParser = new optparse.OptionParser(SWITCHES, BANNER); - o = opts = optionParser.parse(process.argv.slice(2)); - o.compile || (o.compile = !!o.output); - o.run = !(o.compile || o.print || o.map); - o.print = !!(o.print || (o["eval"] || o.stdio && o.compile)); - sources = o["arguments"]; - for (i = _i = 0, _len = sources.length; _i < _len; i = ++_i) { - source = sources[i]; - sourceCode[i] = null; - } - }; - - compileOptions = function(filename, base) { - var answer, cwd, jsDir, jsPath; - answer = { - filename: filename, - literate: opts.literate || helpers.isLiterate(filename), - bare: opts.bare, - header: opts.compile, - sourceMap: opts.map - }; - if (filename) { - if (base) { - cwd = process.cwd(); - jsPath = outputPath(filename, base); - jsDir = path.dirname(jsPath); - answer = helpers.merge(answer, { - jsPath: jsPath, - sourceRoot: path.relative(jsDir, cwd), - sourceFiles: [path.relative(cwd, filename)], - generatedFile: helpers.baseFileName(jsPath, false, useWinPathSep) - }); - } else { - answer = helpers.merge(answer, { - sourceRoot: "", - sourceFiles: [helpers.baseFileName(filename, false, useWinPathSep)], - generatedFile: helpers.baseFileName(filename, true, useWinPathSep) + ".js" - }); - } - } - return answer; - }; - - forkNode = function() { - var args, nodeArgs; - nodeArgs = opts.nodejs.split(/\s+/); - args = process.argv.slice(1); - args.splice(args.indexOf('--nodejs'), 2); - return spawn(process.execPath, nodeArgs.concat(args), { - cwd: process.cwd(), - env: process.env, - customFds: [0, 1, 2] - }); - }; - - usage = function() { - return printLine((new optparse.OptionParser(SWITCHES, BANNER)).help()); - }; - - version = function() { - return printLine("CoffeeScript version " + CoffeeScript.VERSION); - }; - -}).call(this); http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/3016473f/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/grammar.js ---------------------------------------------------------------------- diff --git a/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/grammar.js b/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/grammar.js deleted file mode 100644 index 24d5bac..0000000 --- a/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/grammar.js +++ /dev/null @@ -1,625 +0,0 @@ -// Generated by CoffeeScript 1.6.3 -(function() { - var Parser, alt, alternatives, grammar, name, o, operators, token, tokens, unwrap; - - Parser = require('jison').Parser; - - unwrap = /^function\s*\(\)\s*\{\s*return\s*([\s\S]*);\s*\}/; - - o = function(patternString, action, options) { - var addLocationDataFn, match, patternCount; - patternString = patternString.replace(/\s{2,}/g, ' '); - patternCount = patternString.split(' ').length; - if (!action) { - return [patternString, '$$ = $1;', options]; - } - action = (match = unwrap.exec(action)) ? match[1] : "(" + action + "())"; - action = action.replace(/\bnew /g, '$&yy.'); - action = action.replace(/\b(?:Block\.wrap|extend)\b/g, 'yy.$&'); - addLocationDataFn = function(first, last) { - if (!last) { - return "yy.addLocationDataFn(@" + first + ")"; - } else { - return "yy.addLocationDataFn(@" + first + ", @" + last + ")"; - } - }; - action = action.replace(/LOC\(([0-9]*)\)/g, addLocationDataFn('$1')); - action = action.replace(/LOC\(([0-9]*),\s*([0-9]*)\)/g, addLocationDataFn('$1', '$2')); - return [patternString, "$$ = " + (addLocationDataFn(1, patternCount)) + "(" + action + ");", options]; - }; - - grammar = { - Root: [ - o('', function() { - return new Block; - }), o('Body'), o('Block TERMINATOR') - ], - Body: [ - o('Line', function() { - return Block.wrap([$1]); - }), o('Body TERMINATOR Line', function() { - return $1.push($3); - }), o('Body TERMINATOR') - ], - Line: [o('Expression'), o('Statement')], - Statement: [ - o('Return'), o('Comment'), o('STATEMENT', function() { - return new Literal($1); - }) - ], - Expression: [o('Value'), o('Invocation'), o('Code'), o('Operation'), o('Assign'), o('If'), o('Try'), o('While'), o('For'), o('Switch'), o('Class'), o('Throw')], - Block: [ - o('INDENT OUTDENT', function() { - return new Block; - }), o('INDENT Body OUTDENT', function() { - return $2; - }) - ], - Identifier: [ - o('IDENTIFIER', function() { - return new Literal($1); - }) - ], - AlphaNumeric: [ - o('NUMBER', function() { - return new Literal($1); - }), o('STRING', function() { - return new Literal($1); - }) - ], - Literal: [ - o('AlphaNumeric'), o('JS', function() { - return new Literal($1); - }), o('REGEX', function() { - return new Literal($1); - }), o('DEBUGGER', function() { - return new Literal($1); - }), o('UNDEFINED', function() { - return new Undefined; - }), o('NULL', function() { - return new Null; - }), o('BOOL', function() { - return new Bool($1); - }) - ], - Assign: [ - o('Assignable = Expression', function() { - return new Assign($1, $3); - }), o('Assignable = TERMINATOR Expression', function() { - return new Assign($1, $4); - }), o('Assignable = INDENT Expression OUTDENT', function() { - return new Assign($1, $4); - }) - ], - AssignObj: [ - o('ObjAssignable', function() { - return new Value($1); - }), o('ObjAssignable : Expression', function() { - return new Assign(LOC(1)(new Value($1)), $3, 'object'); - }), o('ObjAssignable :\ - INDENT Expression OUTDENT', function() { - return new Assign(LOC(1)(new Value($1)), $4, 'object'); - }), o('Comment') - ], - ObjAssignable: [o('Identifier'), o('AlphaNumeric'), o('ThisProperty')], - Return: [ - o('RETURN Expression', function() { - return new Return($2); - }), o('RETURN', function() { - return new Return; - }) - ], - Comment: [ - o('HERECOMMENT', function() { - return new Comment($1); - }) - ], - Code: [ - o('PARAM_START ParamList PARAM_END FuncGlyph Block', function() { - return new Code($2, $5, $4); - }), o('FuncGlyph Block', function() { - return new Code([], $2, $1); - }) - ], - FuncGlyph: [ - o('->', function() { - return 'func'; - }), o('=>', function() { - return 'boundfunc'; - }) - ], - OptComma: [o(''), o(',')], - ParamList: [ - o('', function() { - return []; - }), o('Param', function() { - return [$1]; - }), o('ParamList , Param', function() { - return $1.concat($3); - }), o('ParamList OptComma TERMINATOR Param', function() { - return $1.concat($4); - }), o('ParamList OptComma INDENT ParamList OptComma OUTDENT', function() { - return $1.concat($4); - }) - ], - Param: [ - o('ParamVar', function() { - return new Param($1); - }), o('ParamVar ...', function() { - return new Param($1, null, true); - }), o('ParamVar = Expression', function() { - return new Param($1, $3); - }) - ], - ParamVar: [o('Identifier'), o('ThisProperty'), o('Array'), o('Object')], - Splat: [ - o('Expression ...', function() { - return new Splat($1); - }) - ], - SimpleAssignable: [ - o('Identifier', function() { - return new Value($1); - }), o('Value Accessor', function() { - return $1.add($2); - }), o('Invocation Accessor', function() { - return new Value($1, [].concat($2)); - }), o('ThisProperty') - ], - Assignable: [ - o('SimpleAssignable'), o('Array', function() { - return new Value($1); - }), o('Object', function() { - return new Value($1); - }) - ], - Value: [ - o('Assignable'), o('Literal', function() { - return new Value($1); - }), o('Parenthetical', function() { - return new Value($1); - }), o('Range', function() { - return new Value($1); - }), o('This') - ], - Accessor: [ - o('. Identifier', function() { - return new Access($2); - }), o('?. Identifier', function() { - return new Access($2, 'soak'); - }), o(':: Identifier', function() { - return [LOC(1)(new Access(new Literal('prototype'))), LOC(2)(new Access($2))]; - }), o('?:: Identifier', function() { - return [LOC(1)(new Access(new Literal('prototype'), 'soak')), LOC(2)(new Access($2))]; - }), o('::', function() { - return new Access(new Literal('prototype')); - }), o('Index') - ], - Index: [ - o('INDEX_START IndexValue INDEX_END', function() { - return $2; - }), o('INDEX_SOAK Index', function() { - return extend($2, { - soak: true - }); - }) - ], - IndexValue: [ - o('Expression', function() { - return new Index($1); - }), o('Slice', function() { - return new Slice($1); - }) - ], - Object: [ - o('{ AssignList OptComma }', function() { - return new Obj($2, $1.generated); - }) - ], - AssignList: [ - o('', function() { - return []; - }), o('AssignObj', function() { - return [$1]; - }), o('AssignList , AssignObj', function() { - return $1.concat($3); - }), o('AssignList OptComma TERMINATOR AssignObj', function() { - return $1.concat($4); - }), o('AssignList OptComma INDENT AssignList OptComma OUTDENT', function() { - return $1.concat($4); - }) - ], - Class: [ - o('CLASS', function() { - return new Class; - }), o('CLASS Block', function() { - return new Class(null, null, $2); - }), o('CLASS EXTENDS Expression', function() { - return new Class(null, $3); - }), o('CLASS EXTENDS Expression Block', function() { - return new Class(null, $3, $4); - }), o('CLASS SimpleAssignable', function() { - return new Class($2); - }), o('CLASS SimpleAssignable Block', function() { - return new Class($2, null, $3); - }), o('CLASS SimpleAssignable EXTENDS Expression', function() { - return new Class($2, $4); - }), o('CLASS SimpleAssignable EXTENDS Expression Block', function() { - return new Class($2, $4, $5); - }) - ], - Invocation: [ - o('Value OptFuncExist Arguments', function() { - return new Call($1, $3, $2); - }), o('Invocation OptFuncExist Arguments', function() { - return new Call($1, $3, $2); - }), o('SUPER', function() { - return new Call('super', [new Splat(new Literal('arguments'))]); - }), o('SUPER Arguments', function() { - return new Call('super', $2); - }) - ], - OptFuncExist: [ - o('', function() { - return false; - }), o('FUNC_EXIST', function() { - return true; - }) - ], - Arguments: [ - o('CALL_START CALL_END', function() { - return []; - }), o('CALL_START ArgList OptComma CALL_END', function() { - return $2; - }) - ], - This: [ - o('THIS', function() { - return new Value(new Literal('this')); - }), o('@', function() { - return new Value(new Literal('this')); - }) - ], - ThisProperty: [ - o('@ Identifier', function() { - return new Value(LOC(1)(new Literal('this')), [LOC(2)(new Access($2))], 'this'); - }) - ], - Array: [ - o('[ ]', function() { - return new Arr([]); - }), o('[ ArgList OptComma ]', function() { - return new Arr($2); - }) - ], - RangeDots: [ - o('..', function() { - return 'inclusive'; - }), o('...', function() { - return 'exclusive'; - }) - ], - Range: [ - o('[ Expression RangeDots Expression ]', function() { - return new Range($2, $4, $3); - }) - ], - Slice: [ - o('Expression RangeDots Expression', function() { - return new Range($1, $3, $2); - }), o('Expression RangeDots', function() { - return new Range($1, null, $2); - }), o('RangeDots Expression', function() { - return new Range(null, $2, $1); - }), o('RangeDots', function() { - return new Range(null, null, $1); - }) - ], - ArgList: [ - o('Arg', function() { - return [$1]; - }), o('ArgList , Arg', function() { - return $1.concat($3); - }), o('ArgList OptComma TERMINATOR Arg', function() { - return $1.concat($4); - }), o('INDENT ArgList OptComma OUTDENT', function() { - return $2; - }), o('ArgList OptComma INDENT ArgList OptComma OUTDENT', function() { - return $1.concat($4); - }) - ], - Arg: [o('Expression'), o('Splat')], - SimpleArgs: [ - o('Expression'), o('SimpleArgs , Expression', function() { - return [].concat($1, $3); - }) - ], - Try: [ - o('TRY Block', function() { - return new Try($2); - }), o('TRY Block Catch', function() { - return new Try($2, $3[0], $3[1]); - }), o('TRY Block FINALLY Block', function() { - return new Try($2, null, null, $4); - }), o('TRY Block Catch FINALLY Block', function() { - return new Try($2, $3[0], $3[1], $5); - }) - ], - Catch: [ - o('CATCH Identifier Block', function() { - return [$2, $3]; - }), o('CATCH Object Block', function() { - return [LOC(2)(new Value($2)), $3]; - }), o('CATCH Block', function() { - return [null, $2]; - }) - ], - Throw: [ - o('THROW Expression', function() { - return new Throw($2); - }) - ], - Parenthetical: [ - o('( Body )', function() { - return new Parens($2); - }), o('( INDENT Body OUTDENT )', function() { - return new Parens($3); - }) - ], - WhileSource: [ - o('WHILE Expression', function() { - return new While($2); - }), o('WHILE Expression WHEN Expression', function() { - return new While($2, { - guard: $4 - }); - }), o('UNTIL Expression', function() { - return new While($2, { - invert: true - }); - }), o('UNTIL Expression WHEN Expression', function() { - return new While($2, { - invert: true, - guard: $4 - }); - }) - ], - While: [ - o('WhileSource Block', function() { - return $1.addBody($2); - }), o('Statement WhileSource', function() { - return $2.addBody(LOC(1)(Block.wrap([$1]))); - }), o('Expression WhileSource', function() { - return $2.addBody(LOC(1)(Block.wrap([$1]))); - }), o('Loop', function() { - return $1; - }) - ], - Loop: [ - o('LOOP Block', function() { - return new While(LOC(1)(new Literal('true'))).addBody($2); - }), o('LOOP Expression', function() { - return new While(LOC(1)(new Literal('true'))).addBody(LOC(2)(Block.wrap([$2]))); - }) - ], - For: [ - o('Statement ForBody', function() { - return new For($1, $2); - }), o('Expression ForBody', function() { - return new For($1, $2); - }), o('ForBody Block', function() { - return new For($2, $1); - }) - ], - ForBody: [ - o('FOR Range', function() { - return { - source: LOC(2)(new Value($2)) - }; - }), o('ForStart ForSource', function() { - $2.own = $1.own; - $2.name = $1[0]; - $2.index = $1[1]; - return $2; - }) - ], - ForStart: [ - o('FOR ForVariables', function() { - return $2; - }), o('FOR OWN ForVariables', function() { - $3.own = true; - return $3; - }) - ], - ForValue: [ - o('Identifier'), o('ThisProperty'), o('Array', function() { - return new Value($1); - }), o('Object', function() { - return new Value($1); - }) - ], - ForVariables: [ - o('ForValue', function() { - return [$1]; - }), o('ForValue , ForValue', function() { - return [$1, $3]; - }) - ], - ForSource: [ - o('FORIN Expression', function() { - return { - source: $2 - }; - }), o('FOROF Expression', function() { - return { - source: $2, - object: true - }; - }), o('FORIN Expression WHEN Expression', function() { - return { - source: $2, - guard: $4 - }; - }), o('FOROF Expression WHEN Expression', function() { - return { - source: $2, - guard: $4, - object: true - }; - }), o('FORIN Expression BY Expression', function() { - return { - source: $2, - step: $4 - }; - }), o('FORIN Expression WHEN Expression BY Expression', function() { - return { - source: $2, - guard: $4, - step: $6 - }; - }), o('FORIN Expression BY Expression WHEN Expression', function() { - return { - source: $2, - step: $4, - guard: $6 - }; - }) - ], - Switch: [ - o('SWITCH Expression INDENT Whens OUTDENT', function() { - return new Switch($2, $4); - }), o('SWITCH Expression INDENT Whens ELSE Block OUTDENT', function() { - return new Switch($2, $4, $6); - }), o('SWITCH INDENT Whens OUTDENT', function() { - return new Switch(null, $3); - }), o('SWITCH INDENT Whens ELSE Block OUTDENT', function() { - return new Switch(null, $3, $5); - }) - ], - Whens: [ - o('When'), o('Whens When', function() { - return $1.concat($2); - }) - ], - When: [ - o('LEADING_WHEN SimpleArgs Block', function() { - return [[$2, $3]]; - }), o('LEADING_WHEN SimpleArgs Block TERMINATOR', function() { - return [[$2, $3]]; - }) - ], - IfBlock: [ - o('IF Expression Block', function() { - return new If($2, $3, { - type: $1 - }); - }), o('IfBlock ELSE IF Expression Block', function() { - return $1.addElse(new If($4, $5, { - type: $3 - })); - }) - ], - If: [ - o('IfBlock'), o('IfBlock ELSE Block', function() { - return $1.addElse($3); - }), o('Statement POST_IF Expression', function() { - return new If($3, LOC(1)(Block.wrap([$1])), { - type: $2, - statement: true - }); - }), o('Expression POST_IF Expression', function() { - return new If($3, LOC(1)(Block.wrap([$1])), { - type: $2, - statement: true - }); - }) - ], - Operation: [ - o('UNARY Expression', function() { - return new Op($1, $2); - }), o('- Expression', (function() { - return new Op('-', $2); - }), { - prec: 'UNARY' - }), o('+ Expression', (function() { - return new Op('+', $2); - }), { - prec: 'UNARY' - }), o('-- SimpleAssignable', function() { - return new Op('--', $2); - }), o('++ SimpleAssignable', function() { - return new Op('++', $2); - }), o('SimpleAssignable --', function() { - return new Op('--', $1, null, true); - }), o('SimpleAssignable ++', function() { - return new Op('++', $1, null, true); - }), o('Expression ?', function() { - return new Existence($1); - }), o('Expression + Expression', function() { - return new Op('+', $1, $3); - }), o('Expression - Expression', function() { - return new Op('-', $1, $3); - }), o('Expression MATH Expression', function() { - return new Op($2, $1, $3); - }), o('Expression SHIFT Expression', function() { - return new Op($2, $1, $3); - }), o('Expression COMPARE Expression', function() { - return new Op($2, $1, $3); - }), o('Expression LOGIC Expression', function() { - return new Op($2, $1, $3); - }), o('Expression RELATION Expression', function() { - if ($2.charAt(0) === '!') { - return new Op($2.slice(1), $1, $3).invert(); - } else { - return new Op($2, $1, $3); - } - }), o('SimpleAssignable COMPOUND_ASSIGN\ - Expression', function() { - return new Assign($1, $3, $2); - }), o('SimpleAssignable COMPOUND_ASSIGN\ - INDENT Expression OUTDENT', function() { - return new Assign($1, $4, $2); - }), o('SimpleAssignable COMPOUND_ASSIGN TERMINATOR\ - Expression', function() { - return new Assign($1, $4, $2); - }), o('SimpleAssignable EXTENDS Expression', function() { - return new Extends($1, $3); - }) - ] - }; - - operators = [['left', '.', '?.', '::', '?::'], ['left', 'CALL_START', 'CALL_END'], ['nonassoc', '++', '--'], ['left', '?'], ['right', 'UNARY'], ['left', 'MATH'], ['left', '+', '-'], ['left', 'SHIFT'], ['left', 'RELATION'], ['left', 'COMPARE'], ['left', 'LOGIC'], ['nonassoc', 'INDENT', 'OUTDENT'], ['right', '=', ':', 'COMPOUND_ASSIGN', 'RETURN', 'THROW', 'EXTENDS'], ['right', 'FORIN', 'FOROF', 'BY', 'WHEN'], ['right', 'IF', 'ELSE', 'FOR', 'WHILE', 'UNTIL', 'LOOP', 'SUPER', 'CLASS'], ['right', 'POST_IF']]; - - tokens = []; - - for (name in grammar) { - alternatives = grammar[name]; - grammar[name] = (function() { - var _i, _j, _len, _len1, _ref, _results; - _results = []; - for (_i = 0, _len = alternatives.length; _i < _len; _i++) { - alt = alternatives[_i]; - _ref = alt[0].split(' '); - for (_j = 0, _len1 = _ref.length; _j < _len1; _j++) { - token = _ref[_j]; - if (!grammar[token]) { - tokens.push(token); - } - } - if (name === 'Root') { - alt[1] = "return " + alt[1]; - } - _results.push(alt); - } - return _results; - })(); - } - - exports.parser = new Parser({ - tokens: tokens.join(' '), - bnf: grammar, - operators: operators.reverse(), - startSymbol: 'Root' - }); - -}).call(this); http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/3016473f/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/helpers.js ---------------------------------------------------------------------- diff --git a/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/helpers.js b/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/helpers.js deleted file mode 100644 index 352dc36..0000000 --- a/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/helpers.js +++ /dev/null @@ -1,223 +0,0 @@ -// Generated by CoffeeScript 1.6.3 -(function() { - var buildLocationData, extend, flatten, last, repeat, _ref; - - exports.starts = function(string, literal, start) { - return literal === string.substr(start, literal.length); - }; - - exports.ends = function(string, literal, back) { - var len; - len = literal.length; - return literal === string.substr(string.length - len - (back || 0), len); - }; - - exports.repeat = repeat = function(str, n) { - var res; - res = ''; - while (n > 0) { - if (n & 1) { - res += str; - } - n >>>= 1; - str += str; - } - return res; - }; - - exports.compact = function(array) { - var item, _i, _len, _results; - _results = []; - for (_i = 0, _len = array.length; _i < _len; _i++) { - item = array[_i]; - if (item) { - _results.push(item); - } - } - return _results; - }; - - exports.count = function(string, substr) { - var num, pos; - num = pos = 0; - if (!substr.length) { - return 1 / 0; - } - while (pos = 1 + string.indexOf(substr, pos)) { - num++; - } - return num; - }; - - exports.merge = function(options, overrides) { - return extend(extend({}, options), overrides); - }; - - extend = exports.extend = function(object, properties) { - var key, val; - for (key in properties) { - val = properties[key]; - object[key] = val; - } - return object; - }; - - exports.flatten = flatten = function(array) { - var element, flattened, _i, _len; - flattened = []; - for (_i = 0, _len = array.length; _i < _len; _i++) { - element = array[_i]; - if (element instanceof Array) { - flattened = flattened.concat(flatten(element)); - } else { - flattened.push(element); - } - } - return flattened; - }; - - exports.del = function(obj, key) { - var val; - val = obj[key]; - delete obj[key]; - return val; - }; - - exports.last = last = function(array, back) { - return array[array.length - (back || 0) - 1]; - }; - - exports.some = (_ref = Array.prototype.some) != null ? _ref : function(fn) { - var e, _i, _len; - for (_i = 0, _len = this.length; _i < _len; _i++) { - e = this[_i]; - if (fn(e)) { - return true; - } - } - return false; - }; - - exports.invertLiterate = function(code) { - var line, lines, maybe_code; - maybe_code = true; - lines = (function() { - var _i, _len, _ref1, _results; - _ref1 = code.split('\n'); - _results = []; - for (_i = 0, _len = _ref1.length; _i < _len; _i++) { - line = _ref1[_i]; - if (maybe_code && /^([ ]{4}|[ ]{0,3}\t)/.test(line)) { - _results.push(line); - } else if (maybe_code = /^\s*$/.test(line)) { - _results.push(line); - } else { - _results.push('# ' + line); - } - } - return _results; - })(); - return lines.join('\n'); - }; - - buildLocationData = function(first, last) { - if (!last) { - return first; - } else { - return { - first_line: first.first_line, - first_column: first.first_column, - last_line: last.last_line, - last_column: last.last_column - }; - } - }; - - exports.addLocationDataFn = function(first, last) { - return function(obj) { - if (((typeof obj) === 'object') && (!!obj['updateLocationDataIfMissing'])) { - obj.updateLocationDataIfMissing(buildLocationData(first, last)); - } - return obj; - }; - }; - - exports.locationDataToString = function(obj) { - var locationData; - if (("2" in obj) && ("first_line" in obj[2])) { - locationData = obj[2]; - } else if ("first_line" in obj) { - locationData = obj; - } - if (locationData) { - return ("" + (locationData.first_line + 1) + ":" + (locationData.first_column + 1) + "-") + ("" + (locationData.last_line + 1) + ":" + (locationData.last_column + 1)); - } else { - return "No location data"; - } - }; - - exports.baseFileName = function(file, stripExt, useWinPathSep) { - var parts, pathSep; - if (stripExt == null) { - stripExt = false; - } - if (useWinPathSep == null) { - useWinPathSep = false; - } - pathSep = useWinPathSep ? /\\|\// : /\//; - parts = file.split(pathSep); - file = parts[parts.length - 1]; - if (!stripExt) { - return file; - } - parts = file.split('.'); - parts.pop(); - if (parts[parts.length - 1] === 'coffee' && parts.length > 1) { - parts.pop(); - } - return parts.join('.'); - }; - - exports.isCoffee = function(file) { - return /\.((lit)?coffee|coffee\.md)$/.test(file); - }; - - exports.isLiterate = function(file) { - return /\.(litcoffee|coffee\.md)$/.test(file); - }; - - exports.throwSyntaxError = function(message, location) { - var error; - if (location.last_line == null) { - location.last_line = location.first_line; - } - if (location.last_column == null) { - location.last_column = location.first_column; - } - error = new SyntaxError(message); - error.location = location; - throw error; - }; - - exports.prettyErrorMessage = function(error, fileName, code, useColors) { - var codeLine, colorize, end, first_column, first_line, last_column, last_line, marker, message, start, _ref1; - if (!error.location) { - return error.stack || ("" + error); - } - _ref1 = error.location, first_line = _ref1.first_line, first_column = _ref1.first_column, last_line = _ref1.last_line, last_column = _ref1.last_column; - codeLine = code.split('\n')[first_line]; - start = first_column; - end = first_line === last_line ? last_column + 1 : codeLine.length; - marker = repeat(' ', start) + repeat('^', end - start); - if (useColors) { - colorize = function(str) { - return "\x1B[1;31m" + str + "\x1B[0m"; - }; - codeLine = codeLine.slice(0, start) + colorize(codeLine.slice(start, end)) + codeLine.slice(end); - marker = colorize(marker); - } - message = "" + fileName + ":" + (first_line + 1) + ":" + (first_column + 1) + ": error: " + error.message + "\n" + codeLine + "\n" + marker; - return message; - }; - -}).call(this); http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/3016473f/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/index.js ---------------------------------------------------------------------- diff --git a/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/index.js b/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/index.js deleted file mode 100644 index 68787df..0000000 --- a/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/index.js +++ /dev/null @@ -1,11 +0,0 @@ -// Generated by CoffeeScript 1.6.3 -(function() { - var key, val, _ref; - - _ref = require('./coffee-script'); - for (key in _ref) { - val = _ref[key]; - exports[key] = val; - } - -}).call(this);