├── Support ├── JSHint Prefs App │ ├── TextMate.system.Aylott.js │ └── prefs.html ├── node_modules │ ├── .bin │ │ ├── jsx │ │ └── jsbeautify │ ├── jstransform │ │ ├── node_modules │ │ │ ├── .bin │ │ │ │ ├── esparse │ │ │ │ └── esvalidate │ │ │ ├── source-map │ │ │ │ ├── .npmignore │ │ │ │ ├── .travis.yml │ │ │ │ ├── build │ │ │ │ │ ├── test-suffix.js │ │ │ │ │ ├── test-prefix.js │ │ │ │ │ ├── suffix-source-map.jsm │ │ │ │ │ ├── suffix-browser.js │ │ │ │ │ ├── prefix-utils.jsm │ │ │ │ │ ├── suffix-utils.jsm │ │ │ │ │ ├── prefix-source-map.jsm │ │ │ │ │ ├── assert-shim.js │ │ │ │ │ └── mini-require.js │ │ │ │ ├── lib │ │ │ │ │ ├── source-map.js │ │ │ │ │ └── source-map │ │ │ │ │ │ ├── base64.js │ │ │ │ │ │ ├── array-set.js │ │ │ │ │ │ ├── binary-search.js │ │ │ │ │ │ └── base64-vlq.js │ │ │ │ ├── test │ │ │ │ │ ├── source-map │ │ │ │ │ │ ├── test-base64-vlq.js │ │ │ │ │ │ ├── test-api.js │ │ │ │ │ │ ├── test-base64.js │ │ │ │ │ │ ├── test-binary-search.js │ │ │ │ │ │ ├── test-dog-fooding.js │ │ │ │ │ │ └── test-array-set.js │ │ │ │ │ └── run-tests.js │ │ │ │ ├── node_modules │ │ │ │ │ └── amdefine │ │ │ │ │ │ ├── intercept.js │ │ │ │ │ │ └── LICENSE │ │ │ │ ├── LICENSE │ │ │ │ ├── CHANGELOG.md │ │ │ │ └── Makefile.dryice.js │ │ │ ├── base62 │ │ │ │ ├── .travis.yml │ │ │ │ ├── test │ │ │ │ │ └── test.js │ │ │ │ ├── base62.js │ │ │ │ ├── Readme.md │ │ │ │ ├── LICENSE │ │ │ │ └── package.json │ │ │ └── esprima-fb │ │ │ │ ├── README.md │ │ │ │ ├── package.json │ │ │ │ └── bin │ │ │ │ └── esparse.js │ │ ├── .npmignore │ │ ├── jestEnvironment.js │ │ ├── .travis.yml │ │ ├── jestPreprocessor.js │ │ ├── .jshintrc │ │ ├── visitors │ │ │ ├── es6-object-short-notation-visitors.js │ │ │ ├── reserved-words-helper.js │ │ │ ├── es6-object-concise-method-visitors.js │ │ │ ├── reserved-words-visitors.js │ │ │ ├── es7-rest-property-helpers.js │ │ │ ├── es7-spread-property-visitors.js │ │ │ ├── es6-rest-param-visitors.js │ │ │ ├── es6-call-spread-visitors.js │ │ │ ├── es6-arrow-function-visitors.js │ │ │ └── es6-template-visitors.js │ │ ├── polyfill │ │ │ └── Object.es6.js │ │ ├── src │ │ │ └── docblock.js │ │ ├── package.json │ │ └── README.md │ └── js-beautify-node │ │ ├── README.markdown │ │ ├── LICENSE.txt │ │ ├── package.json │ │ └── tests │ │ └── sanitytest.js ├── bin │ ├── jsl │ ├── js.jar │ ├── compiler.jar │ ├── shrinksafe.jar │ ├── yuicompressor.jar │ ├── packr-1.0.2 │ │ ├── lib │ │ │ ├── string.rb │ │ │ └── packr │ │ │ │ ├── words.rb │ │ │ │ └── regexp_group.rb │ │ └── README │ ├── compress_dean_edwards.rb │ ├── quick_lint.rb │ ├── bs.js │ ├── js-beautify │ │ ├── license.txt │ │ ├── bin │ │ │ └── beautify_js │ │ ├── javascriptobfuscator_unpacker.js │ │ ├── beautify-cl.js │ │ └── sanitytest.js │ ├── jshint.textmate.js │ └── TextMate.js ├── .gitignore ├── package.json ├── photoshop-eval-deprecated.sh ├── convert-es6.js └── conf │ └── jsl.textmate.conf ├── Proxies └── Validate Quick On Save.tmProxy ├── Commands ├── Run with Plask.tmCommand ├── Edit JSLint settings.tmCommand ├── Validate with JSLint (Quick).tmCommand ├── Kill Node Inspector.tmCommand ├── Compress with JSMin.tmCommand ├── Compress with Dean Edwards Packer.tmCommand ├── Minimize selection with JSMin.tmCommand ├── Validate with JSLint.tmCommand ├── Launch Node Inspector.tmCommand ├── Compress with Dojo ShrinkSafe.tmCommand ├── Validate with Google Closure Compiler.tmCommand ├── Run Javascript in PhantomJS.tmCommand ├── Compress with Google Closure Compiler.tmCommand ├── Help.tmCommand ├── Compress with YUI! Compressor.tmCommand ├── Compress with YUI! Compressor CSS.tmCommand ├── Convert ES6.tmCommand ├── Run JavaScript with osascript.tmCommand ├── Validate with JSHint (Quick).tmCommand ├── Debug in Node_js Inspector.tmCommand ├── Debug with Node_js.tmCommand ├── Validate with JSHint.tmCommand ├── Reformat with JS Beautifier (Rhino).tmCommand ├── Reformat with JS Beautifier (Node_js).tmCommand ├── Run in Node_js.tmCommand └── Run with Photoshop.tmCommand ├── Macros ├── Convert Bookmarklet to Javascript ᵇᵉᵗᵃ.tmMacro └── Convert Javascript to Bookmarklet ᵇᵉᵗᵃ.tmMacro └── info.plist /Support/JSHint Prefs App/TextMate.system.Aylott.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Support/node_modules/.bin/jsx: -------------------------------------------------------------------------------- 1 | ../react-tools/bin/jsx -------------------------------------------------------------------------------- /Support/node_modules/.bin/jsbeautify: -------------------------------------------------------------------------------- 1 | ../js-beautify-node/beautify-node.js -------------------------------------------------------------------------------- /Support/node_modules/jstransform/node_modules/.bin/esparse: -------------------------------------------------------------------------------- 1 | ../esprima-fb/bin/esparse.js -------------------------------------------------------------------------------- /Support/node_modules/jstransform/.npmignore: -------------------------------------------------------------------------------- 1 | .DS_STORE 2 | node_modules 3 | *.swp 4 | *~ 5 | -------------------------------------------------------------------------------- /Support/node_modules/jstransform/node_modules/.bin/esvalidate: -------------------------------------------------------------------------------- 1 | ../esprima-fb/bin/esvalidate.js -------------------------------------------------------------------------------- /Support/node_modules/jstransform/node_modules/source-map/.npmignore: -------------------------------------------------------------------------------- 1 | dist/* 2 | node_modules/* 3 | -------------------------------------------------------------------------------- /Support/bin/jsl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subtleGradient/javascript-tools.tmbundle/HEAD/Support/bin/jsl -------------------------------------------------------------------------------- /Support/node_modules/jstransform/jestEnvironment.js: -------------------------------------------------------------------------------- 1 | require.requireActual('./polyfill/Object.es6.js'); 2 | -------------------------------------------------------------------------------- /Support/bin/js.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subtleGradient/javascript-tools.tmbundle/HEAD/Support/bin/js.jar -------------------------------------------------------------------------------- /Support/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/jstransform/node_modules/esprima-fb/test 2 | node_modules/jstransform/*/__tests__ 3 | -------------------------------------------------------------------------------- /Support/node_modules/jstransform/node_modules/base62/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - 0.6 4 | - 0.8 -------------------------------------------------------------------------------- /Support/bin/compiler.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subtleGradient/javascript-tools.tmbundle/HEAD/Support/bin/compiler.jar -------------------------------------------------------------------------------- /Support/bin/shrinksafe.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subtleGradient/javascript-tools.tmbundle/HEAD/Support/bin/shrinksafe.jar -------------------------------------------------------------------------------- /Support/node_modules/jstransform/node_modules/source-map/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - 0.8 4 | - "0.10" -------------------------------------------------------------------------------- /Support/bin/yuicompressor.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subtleGradient/javascript-tools.tmbundle/HEAD/Support/bin/yuicompressor.jar -------------------------------------------------------------------------------- /Support/bin/packr-1.0.2/lib/string.rb: -------------------------------------------------------------------------------- 1 | class String 2 | def rescape 3 | gsub(/([\/()\[\]{}|*+-.,^$?\\])/, "\\\\1") 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /Support/node_modules/jstransform/node_modules/source-map/build/test-suffix.js: -------------------------------------------------------------------------------- 1 | function run_test() { 2 | runSourceMapTests('{THIS_MODULE}', do_throw); 3 | } 4 | -------------------------------------------------------------------------------- /Support/node_modules/jstransform/node_modules/source-map/build/test-prefix.js: -------------------------------------------------------------------------------- 1 | /* 2 | * WARNING! 3 | * 4 | * Do not edit this file directly, it is built from the sources at 5 | * https://github.com/mozilla/source-map/ 6 | */ 7 | 8 | Components.utils.import('resource://test/Utils.jsm'); 9 | -------------------------------------------------------------------------------- /Support/bin/compress_dean_edwards.rb: -------------------------------------------------------------------------------- 1 | require 'ftools' 2 | require "#{ENV['TM_BUNDLE_SUPPORT']}/bin/packr-1.0.2/lib/packr.rb" 3 | 4 | File::copy("#{ENV['TM_FILEPATH']}", '/tmp/compress_this_file.js') 5 | Packr.pack_file('/tmp/compress_this_file.js', :shrink_vars => true, :base62 => !ENV['TM_JST_PB62'].nil?) 6 | packed = File::read('/tmp/compress_this_file.js') 7 | puts packed -------------------------------------------------------------------------------- /Support/node_modules/jstransform/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - "0.10" 4 | # Because of package.json dependency versions that start with '^', it's not 5 | # possible to `npm install` using the version of npm packaged with node 0.8 6 | # As a result, travis *always* fails for 0.8 now -- and thus it's not possible 7 | # to test jstransform on 0.8 with Travis CI :( 8 | # - "0.8" 9 | -------------------------------------------------------------------------------- /Support/node_modules/jstransform/node_modules/source-map/build/suffix-source-map.jsm: -------------------------------------------------------------------------------- 1 | /* -*- Mode: js; js-indent-level: 2; -*- */ 2 | /////////////////////////////////////////////////////////////////////////////// 3 | 4 | this.SourceMapConsumer = require('source-map/source-map-consumer').SourceMapConsumer; 5 | this.SourceMapGenerator = require('source-map/source-map-generator').SourceMapGenerator; 6 | this.SourceNode = require('source-map/source-node').SourceNode; 7 | -------------------------------------------------------------------------------- /Support/node_modules/jstransform/node_modules/source-map/build/suffix-browser.js: -------------------------------------------------------------------------------- 1 | /* -*- Mode: js; js-indent-level: 2; -*- */ 2 | /////////////////////////////////////////////////////////////////////////////// 3 | 4 | this.sourceMap = { 5 | SourceMapConsumer: require('source-map/source-map-consumer').SourceMapConsumer, 6 | SourceMapGenerator: require('source-map/source-map-generator').SourceMapGenerator, 7 | SourceNode: require('source-map/source-node').SourceNode 8 | }; 9 | -------------------------------------------------------------------------------- /Support/node_modules/jstransform/node_modules/base62/test/test.js: -------------------------------------------------------------------------------- 1 | var assert = require('assert') 2 | var Base62 = require('../base62') 3 | 4 | describe("encode", function() { 5 | it("should encode a number to a Base62 string", function() { 6 | assert.equal(Base62.encode(999), 'g7') 7 | }); 8 | }); 9 | 10 | describe("decode", function() { 11 | it("should decode a number from a Base62 string", function() { 12 | assert.equal(Base62.decode('g7'), 999) 13 | }); 14 | }); -------------------------------------------------------------------------------- /Support/node_modules/jstransform/node_modules/source-map/lib/source-map.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009-2011 Mozilla Foundation and contributors 3 | * Licensed under the New BSD license. See LICENSE.txt or: 4 | * http://opensource.org/licenses/BSD-3-Clause 5 | */ 6 | exports.SourceMapGenerator = require('./source-map/source-map-generator').SourceMapGenerator; 7 | exports.SourceMapConsumer = require('./source-map/source-map-consumer').SourceMapConsumer; 8 | exports.SourceNode = require('./source-map/source-node').SourceNode; 9 | -------------------------------------------------------------------------------- /Support/bin/quick_lint.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | FILENAME = ENV['TM_FILENAME'] 3 | FILEPATH = ENV['TM_FILEPATH'] 4 | SUPPORT = ENV['TM_BUNDLE_SUPPORT'] 5 | BINARY = "#{SUPPORT}/bin/jsl" 6 | # BINARY = `uname -a` =~ /i386/ ? "#{SUPPORT}/bin/intel/jsl" : "#{SUPPORT}/bin/ppc/jsl" 7 | 8 | output = `"#{BINARY}" -process "#{FILEPATH}" -nologo -conf "#{SUPPORT}/conf/jsl.textmate.conf"` 9 | 10 | # the "X error(s), Y warning(s)" line will always be at the end 11 | results = output.split(/\n/).pop 12 | puts results unless results == "0 error(s), 0 warning(s)" 13 | -------------------------------------------------------------------------------- /Proxies/Validate Quick On Save.tmProxy: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | validate.quick 7 | name 8 | Validate Quick On Save 9 | scope 10 | source.es, source.js 11 | semanticClass 12 | callback.document.did-save 13 | uuid 14 | 8CA136A0-6648-4DA0-9253-9A1F1F9967E7 15 | 16 | 17 | -------------------------------------------------------------------------------- /Support/node_modules/jstransform/jestPreprocessor.js: -------------------------------------------------------------------------------- 1 | var jstransform = require('./src/jstransform'); 2 | var arrowFuncVisitors = require('./visitors/es6-arrow-function-visitors'); 3 | var restParamVisitors = require('./visitors/es6-rest-param-visitors'); 4 | var es7SpreadPropertyVisitors = require('./visitors/es7-spread-property-visitors'); 5 | 6 | exports.process = function(sourceText, sourcePath) { 7 | return jstransform.transform( 8 | arrowFuncVisitors.visitorList 9 | .concat(restParamVisitors.visitorList) 10 | .concat(es7SpreadPropertyVisitors.visitorList), 11 | sourceText 12 | ).code; 13 | }; 14 | -------------------------------------------------------------------------------- /Support/node_modules/jstransform/.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "boss": true, 3 | "curly": true, 4 | "devel": false, 5 | "eqnull": false, 6 | "esnext": true, 7 | "expr": true, 8 | "funcscope": true, 9 | "globals": { 10 | "afterEach": true, 11 | "beforeEach": true, 12 | "describe": true, 13 | "expect": true, 14 | "it": true, 15 | "jest": true 16 | }, 17 | "globalstrict": false, 18 | "laxbreak": true, 19 | "loopfunc": false, 20 | "newcap": true, 21 | "node": true, 22 | "noempty": true, 23 | "nonstandard": false, 24 | "onecase": false, 25 | "trailing": true, 26 | "undef": true, 27 | "unused": "vars" 28 | } 29 | -------------------------------------------------------------------------------- /Support/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "TextMate-JavaScript-Tools-Support", 3 | "description": "Support files for the TextMate JavaScript Tools bundle", 4 | "version": "0.1.0", 5 | "repository": { 6 | "url": "git://github.com/subtleGradient/node-Support.git" 7 | }, 8 | "main": "index.js", 9 | "scripts": { 10 | "test": "tap test/*.js" 11 | }, 12 | "dependencies": { 13 | "js-beautify-node": "^1.0.0", 14 | "jstransform": "^9.1.1" 15 | }, 16 | "devDependencies": { 17 | "tap": "~0.2" 18 | }, 19 | "author": "Thomas Aylott (http://subtlegradient.com)", 20 | "copyright": "2013 Facebook", 21 | "license": "MIT" 22 | } 23 | -------------------------------------------------------------------------------- /Support/node_modules/jstransform/node_modules/source-map/build/prefix-utils.jsm: -------------------------------------------------------------------------------- 1 | /* -*- Mode: js; js-indent-level: 2; -*- */ 2 | /* 3 | * Copyright 2011 Mozilla Foundation and contributors 4 | * Licensed under the New BSD license. See LICENSE or: 5 | * http://opensource.org/licenses/BSD-3-Clause 6 | */ 7 | 8 | /* 9 | * WARNING! 10 | * 11 | * Do not edit this file directly, it is built from the sources at 12 | * https://github.com/mozilla/source-map/ 13 | */ 14 | 15 | Components.utils.import('resource://gre/modules/devtools/Require.jsm'); 16 | Components.utils.import('resource://gre/modules/devtools/SourceMap.jsm'); 17 | 18 | this.EXPORTED_SYMBOLS = [ "define", "runSourceMapTests" ]; 19 | -------------------------------------------------------------------------------- /Support/node_modules/jstransform/node_modules/source-map/build/suffix-utils.jsm: -------------------------------------------------------------------------------- 1 | /* -*- Mode: js; js-indent-level: 2; -*- */ 2 | /* 3 | * Copyright 2011 Mozilla Foundation and contributors 4 | * Licensed under the New BSD license. See LICENSE or: 5 | * http://opensource.org/licenses/BSD-3-Clause 6 | */ 7 | function runSourceMapTests(modName, do_throw) { 8 | let mod = require(modName); 9 | let assert = require('test/source-map/assert'); 10 | let util = require('test/source-map/util'); 11 | 12 | assert.init(do_throw); 13 | 14 | for (let k in mod) { 15 | if (/^test/.test(k)) { 16 | mod[k](assert, util); 17 | } 18 | } 19 | 20 | } 21 | this.runSourceMapTests = runSourceMapTests; 22 | -------------------------------------------------------------------------------- /Support/node_modules/js-beautify-node/README.markdown: -------------------------------------------------------------------------------- 1 | # JS Beautifier, node.js version 2 | 3 | A fork of 4 | [github.com/carlo/js-beautify-node](https://github.com/carlo/js-beautify-node to make 5 | it run as a command line utility 6 | 7 | 8 | ## Usage 9 | 10 | Beautify from the command line: 11 | 12 | jsbeautify [options] [file || URL || STDIN] 13 | 14 | 15 | ## Requirements 16 | 17 | * node.js 18 | 19 | 20 | ## Acknowledgements 21 | 22 | - The original [JS Beautifier](http://github.com/einars/js-beautify) from [Einar Lielmanis](mailto:einar@jsbeautifier.org). 23 | - [JS Beautifier Node](https://github.com/carlo/js-beautify-node 24 | 25 | 26 | ## License 27 | 28 | MIT-License, see `LICENSE.txt`. 29 | -------------------------------------------------------------------------------- /Support/node_modules/jstransform/node_modules/source-map/build/prefix-source-map.jsm: -------------------------------------------------------------------------------- 1 | /* -*- Mode: js; js-indent-level: 2; -*- */ 2 | /* 3 | * Copyright 2011 Mozilla Foundation and contributors 4 | * Licensed under the New BSD license. See LICENSE or: 5 | * http://opensource.org/licenses/BSD-3-Clause 6 | */ 7 | 8 | /* 9 | * WARNING! 10 | * 11 | * Do not edit this file directly, it is built from the sources at 12 | * https://github.com/mozilla/source-map/ 13 | */ 14 | 15 | /////////////////////////////////////////////////////////////////////////////// 16 | 17 | 18 | this.EXPORTED_SYMBOLS = [ "SourceMapConsumer", "SourceMapGenerator", "SourceNode" ]; 19 | 20 | Components.utils.import('resource://gre/modules/devtools/Require.jsm'); 21 | -------------------------------------------------------------------------------- /Commands/Run with Plask.tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | #!/usr/bin/env bash 9 | open -a PlaskLauncher.app "$TM_FILEPATH" 10 | 11 | input 12 | none 13 | keyEquivalent 14 | ^~@R 15 | name 16 | Run with Plask 17 | outputLocation 18 | discard 19 | scope 20 | source.js, source.es 21 | uuid 22 | 30851E85-9CFD-4C15-8FC4-60CEA0D04BC2 23 | 24 | 25 | -------------------------------------------------------------------------------- /Commands/Edit JSLint settings.tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | #!/usr/bin/env bash -l 9 | source "$TM_SUPPORT_PATH/lib/bash_init.sh" # might not be necessary 10 | mate "$TM_BUNDLE_SUPPORT/conf/jsl.textmate.conf" 11 | 12 | input 13 | none 14 | name 15 | Edit JSLint settings 16 | output 17 | discard 18 | scope 19 | source.js 20 | uuid 21 | 02917AD5-E190-40B5-998A-DD7DBC79BAF0 22 | 23 | 24 | -------------------------------------------------------------------------------- /Support/node_modules/jstransform/node_modules/source-map/test/source-map/test-base64-vlq.js: -------------------------------------------------------------------------------- 1 | /* -*- Mode: js; js-indent-level: 2; -*- */ 2 | /* 3 | * Copyright 2011 Mozilla Foundation and contributors 4 | * Licensed under the New BSD license. See LICENSE or: 5 | * http://opensource.org/licenses/BSD-3-Clause 6 | */ 7 | if (typeof define !== 'function') { 8 | var define = require('amdefine')(module, require); 9 | } 10 | define(function (require, exports, module) { 11 | 12 | var base64VLQ = require('../../lib/source-map/base64-vlq'); 13 | 14 | exports['test normal encoding and decoding'] = function (assert, util) { 15 | var result; 16 | for (var i = -255; i < 256; i++) { 17 | result = base64VLQ.decode(base64VLQ.encode(i)); 18 | assert.ok(result); 19 | assert.equal(result.value, i); 20 | assert.equal(result.rest, ""); 21 | } 22 | }; 23 | 24 | }); 25 | -------------------------------------------------------------------------------- /Commands/Validate with JSLint (Quick).tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | saveActiveFile 7 | command 8 | #!/usr/bin/env bash -l 9 | source "$TM_SUPPORT_PATH/lib/bash_init.sh" # might not be necessary 10 | # runs on save; only notifies you if it raises a warning or error 11 | ruby "$TM_BUNDLE_SUPPORT/bin/quick_lint.rb" 12 | 13 | input 14 | none 15 | name 16 | Validate with JSLint (Quick) 17 | output 18 | showAsTooltip 19 | scope 20 | source.js 21 | uuid 22 | F2A344A2-8546-41E8-BC60-EA331D4EF7B8 23 | 24 | 25 | -------------------------------------------------------------------------------- /Commands/Kill Node Inspector.tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | #!/usr/bin/env bash -l 9 | source "$TM_SUPPORT_PATH/lib/bash_init.sh" # might not be necessary 10 | ps|grep node-inspector|xargs -n 1|head -1|xargs kill 11 | ps|grep node-inspector|grep -v grep 12 | 13 | input 14 | none 15 | keyEquivalent 16 | ^~@R 17 | name 18 | Kill Node Inspector 19 | output 20 | showAsTooltip 21 | scope 22 | source.js 23 | uuid 24 | F1DF7529-7815-4FF8-918C-87BA71453EE3 25 | 26 | 27 | -------------------------------------------------------------------------------- /Support/node_modules/jstransform/node_modules/base62/base62.js: -------------------------------------------------------------------------------- 1 | var Base62 = (function (my) { 2 | my.chars = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"] 3 | 4 | my.encode = function(i){ 5 | if (i === 0) {return '0'} 6 | var s = '' 7 | while (i > 0) { 8 | s = this.chars[i % 62] + s 9 | i = Math.floor(i/62) 10 | } 11 | return s 12 | }; 13 | my.decode = function(a,b,c,d){ 14 | for ( 15 | b = c = ( 16 | a === (/\W|_|^$/.test(a += "") || a) 17 | ) - 1; 18 | d = a.charCodeAt(c++); 19 | ) 20 | b = b * 62 + d - [, 48, 29, 87][d >> 5]; 21 | return b 22 | }; 23 | 24 | return my; 25 | }({})); 26 | 27 | module.exports = Base62 -------------------------------------------------------------------------------- /Commands/Compress with JSMin.tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | #!/usr/bin/env bash -l 9 | source "$TM_SUPPORT_PATH/lib/bash_init.sh" # might not be necessary 10 | ruby "$TM_BUNDLE_SUPPORT/bin/jsmin.rb" 11 | 12 | fallbackInput 13 | scope 14 | input 15 | selection 16 | keyEquivalent 17 | ^@c 18 | name 19 | Compress with JSMin 20 | output 21 | replaceSelectedText 22 | scope 23 | source.js -entity.name.tag.script.html 24 | uuid 25 | D3210BEC-4A3A-4FA9-8D7C-1A0F8065CFF5 26 | 27 | 28 | -------------------------------------------------------------------------------- /Commands/Compress with Dean Edwards Packer.tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | #!/usr/bin/env bash -l 9 | source "$TM_SUPPORT_PATH/lib/bash_init.sh" # might not be necessary 10 | ruby "$TM_BUNDLE_SUPPORT/bin/compress_dean_edwards.rb" 11 | 12 | fallbackInput 13 | scope 14 | input 15 | selection 16 | keyEquivalent 17 | ^@c 18 | name 19 | Compress with Dean Edwards Packer 20 | output 21 | replaceSelectedText 22 | scope 23 | source.js -entity.name.tag.script.html 24 | uuid 25 | 16D885D1-78B1-47F2-9BCC-1F27B77B987E 26 | 27 | 28 | -------------------------------------------------------------------------------- /Commands/Minimize selection with JSMin.tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | #!/usr/bin/env bash -l 9 | source "$TM_SUPPORT_PATH/lib/bash_init.sh" # might not be necessary 10 | ruby -e 'print `ruby "$TM_BUNDLE_SUPPORT/bin/jsmin.rb"`[1..-1]' 11 | 12 | fallbackInput 13 | scope 14 | input 15 | selection 16 | keyEquivalent 17 | ^~Q 18 | name 19 | Minimize selection with JSMin 20 | output 21 | replaceSelectedText 22 | scope 23 | source.js -entity.name.tag.script.html, source.actionscript 24 | uuid 25 | E620A7EF-DB9B-48D9-874F-60EAF426E70D 26 | 27 | 28 | -------------------------------------------------------------------------------- /Commands/Validate with JSLint.tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | saveActiveFile 7 | command 8 | #!/usr/bin/env bash -l 9 | source "$TM_SUPPORT_PATH/lib/bash_init.sh" # might not be necessary 10 | . "$TM_SUPPORT_PATH/lib/webpreview.sh" 11 | html_header "Validate Javascript" 12 | ruby "$TM_BUNDLE_SUPPORT/bin/lint.rb" 13 | html_footer 14 | 15 | fallbackInput 16 | scope 17 | input 18 | selection 19 | keyEquivalent 20 | ^V 21 | name 22 | Validate with JSLint 23 | output 24 | showAsHTML 25 | scope 26 | source.js 27 | uuid 28 | 4108455E-925C-4009-B87F-4635199F6DE7 29 | 30 | 31 | -------------------------------------------------------------------------------- /Support/node_modules/jstransform/node_modules/source-map/test/source-map/test-api.js: -------------------------------------------------------------------------------- 1 | /* -*- Mode: js; js-indent-level: 2; -*- */ 2 | /* 3 | * Copyright 2012 Mozilla Foundation and contributors 4 | * Licensed under the New BSD license. See LICENSE or: 5 | * http://opensource.org/licenses/BSD-3-Clause 6 | */ 7 | if (typeof define !== 'function') { 8 | var define = require('amdefine')(module, require); 9 | } 10 | define(function (require, exports, module) { 11 | 12 | var sourceMap; 13 | try { 14 | sourceMap = require('../../lib/source-map'); 15 | } catch (e) { 16 | sourceMap = {}; 17 | Components.utils.import('resource:///modules/devtools/SourceMap.jsm', sourceMap); 18 | } 19 | 20 | exports['test that the api is properly exposed in the top level'] = function (assert, util) { 21 | assert.equal(typeof sourceMap.SourceMapGenerator, "function"); 22 | assert.equal(typeof sourceMap.SourceMapConsumer, "function"); 23 | assert.equal(typeof sourceMap.SourceNode, "function"); 24 | }; 25 | 26 | }); 27 | -------------------------------------------------------------------------------- /Commands/Launch Node Inspector.tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | #!/usr/bin/env bash -l 9 | source "$TM_SUPPORT_PATH/lib/bash_init.sh" # might not be necessary 10 | . "$TM_SUPPORT_PATH/lib/html.sh" 11 | 12 | redirect "http://0.0.0.0:8080/debug?port=5858" 13 | 14 | ps|grep node-inspector|xargs -n 1|head -1|xargs kill 15 | 16 | node-inspector 2>&1 >/dev/null & 17 | 18 | input 19 | none 20 | keyEquivalent 21 | ^~@R 22 | name 23 | Launch Node Inspector 24 | output 25 | showAsHTML 26 | scope 27 | source.js 28 | uuid 29 | AB09302E-EE14-4464-92AB-240F0DD26596 30 | 31 | 32 | -------------------------------------------------------------------------------- /Support/node_modules/jstransform/node_modules/base62/Readme.md: -------------------------------------------------------------------------------- 1 | # Base62.js 2 | [![build status](https://secure.travis-ci.org/andrew/base62.js.png)](http://travis-ci.org/andrew/base62.js) 3 | 4 | A javascript Base62 encode/decoder for node.js 5 | 6 | ## Install 7 | 8 | npm install base62 9 | 10 | ## Usage 11 | 12 | Base62 = require('base62') 13 | Base62.encode(999) // 'g7' 14 | Base62.decode('g7') // 999 15 | 16 | ## Development 17 | 18 | Source hosted at [GitHub](http://github.com/andrew/base62.js). 19 | Report Issues/Feature requests on [GitHub Issues](http://github.com/andrew/split/base62.js). 20 | 21 | ### Note on Patches/Pull Requests 22 | 23 | * Fork the project. 24 | * Make your feature addition or bug fix. 25 | * Add tests for it. This is important so I don't break it in a future version unintentionally. 26 | * Send me a pull request. Bonus points for topic branches. 27 | 28 | ## Copyright 29 | 30 | Copyright (c) 2012 Andrew Nesbitt. See [LICENSE](https://github.com/andrew/base62.js/blob/master/LICENSE) for details. 31 | -------------------------------------------------------------------------------- /Commands/Compress with Dojo ShrinkSafe.tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | #!/usr/bin/env bash -l 9 | source "$TM_SUPPORT_PATH/lib/bash_init.sh" # might not be necessary 10 | cat >'/tmp/compress_this_file.js' 11 | java -jar "$TM_BUNDLE_SUPPORT/bin/shrinksafe.jar" -c '/tmp/compress_this_file.js' 12 | 13 | fallbackInput 14 | scope 15 | input 16 | selection 17 | keyEquivalent 18 | ^@c 19 | name 20 | Compress with Dojo ShrinkSafe 21 | output 22 | replaceSelectedText 23 | scope 24 | source.js -entity.name.tag.script.html 25 | uuid 26 | 0B51E320-D218-4352-8AEF-096B3232E818 27 | 28 | 29 | -------------------------------------------------------------------------------- /Commands/Validate with Google Closure Compiler.tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | #!/usr/bin/env bash -l 9 | source "$TM_SUPPORT_PATH/lib/bash_init.sh" # might not be necessary 10 | . "$TM_SUPPORT_PATH/lib/webpreview.sh" 11 | html_header "Validate Javascript" 12 | ruby "$TM_BUNDLE_SUPPORT/bin/lint-gcc.rb" 13 | html_footer 14 | 15 | fallbackInput 16 | scope 17 | input 18 | selection 19 | keyEquivalent 20 | ^V 21 | name 22 | Validate with Google Closure Compiler 23 | output 24 | showAsHTML 25 | scope 26 | source.js -entity.name.tag.script.html 27 | uuid 28 | 88D4CEE6-2D1F-4B65-A04D-F4ABBC8F9145 29 | 30 | 31 | -------------------------------------------------------------------------------- /Commands/Run Javascript in PhantomJS.tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | #!/usr/bin/env bash -l 9 | source "$TM_SUPPORT_PATH/lib/bash_init.sh" # might not be necessary 10 | . "$TM_SUPPORT_PATH/lib/webpreview.sh" 11 | html_header "Run JavaScript in PhantomJS" 12 | 13 | require_cmd phantomjs 14 | 15 | phantomjs "$TM_FILEPATH" | pre | "$TM_BUNDLE_SUPPORT/bin/TextMate.js" linkPaths 16 | 17 | html_footer 18 | 19 | input 20 | selection 21 | keyEquivalent 22 | ~@R 23 | name 24 | Run Javascript in PhantomJS 25 | output 26 | showAsHTML 27 | scope 28 | source.js, source.js.phantomjs 29 | uuid 30 | DE5BE8AC-EDA3-4C1E-BDDE-FAD45F2D1B5C 31 | 32 | 33 | -------------------------------------------------------------------------------- /Commands/Compress with Google Closure Compiler.tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | #!/usr/bin/env bash -l 9 | source "$TM_SUPPORT_PATH/lib/bash_init.sh" # might not be necessary 10 | cat >'/tmp/compress_this_file.js'; 11 | java -jar "$TM_BUNDLE_SUPPORT/bin/compiler.jar" --warning_level QUIET --js '/tmp/compress_this_file.js' 12 | 13 | fallbackInput 14 | scope 15 | input 16 | selection 17 | keyEquivalent 18 | ^@c 19 | name 20 | Compress with Google Closure Compiler 21 | output 22 | replaceSelectedText 23 | scope 24 | source.js -entity.name.tag.script.html 25 | uuid 26 | 9E7612FA-58B7-43AD-BCC4-F7989D953137 27 | 28 | 29 | -------------------------------------------------------------------------------- /Support/photoshop-eval-deprecated.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Forked from https://github.com/tlrobinson/narwhal-photoshop by Tom Robinson 3 | 4 | SCRIPT="$(cat)" 5 | 6 | stdout_fifo="$TMPDIR/photoshop-$$-stdout" 7 | stderr_fifo="$TMPDIR/photoshop-$$-stderr" 8 | 9 | rm -f "$stdout_fifo" 10 | rm -f "$stderr_fifo" 11 | 12 | mkfifo "$stdout_fifo" 13 | mkfifo "$stderr_fifo" 14 | 15 | cat "$stdout_fifo" > /dev/stdout & 16 | cat "$stderr_fifo" > /dev/stderr & 17 | 18 | osascript \ 19 | -e 'on run argv' \ 20 | -e 'tell application "Adobe Photoshop CC 2014" to do javascript (item 1 of argv) -- show debugger on runtime error' \ 21 | -e 'end run' \ 22 | " 23 | __stdout__ = new File('$stdout_fifo') 24 | __stdout__.open('w') 25 | $.write = function(){return __stdout__.write.apply(__stdout__, arguments)} 26 | $.writeln = function(){return __stdout__.writeln.apply(__stdout__, arguments)} 27 | 28 | __stderr__ = new File('$stderr_fifo') 29 | __stderr__.open('w') 30 | 31 | try { 32 | $SCRIPT 33 | } 34 | catch(e){ 35 | __stderr__.writeln(e) 36 | e 37 | } 38 | " 39 | 40 | rm "$stdout_fifo" 41 | rm "$stderr_fifo" 42 | -------------------------------------------------------------------------------- /Commands/Help.tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | #!/usr/bin/env bash -l 9 | source "$TM_SUPPORT_PATH/lib/bash_init.sh" # might not be necessary 10 | . "$TM_SUPPORT_PATH/lib/webpreview.sh" 11 | html_header "Javascript Tools Help" "Javascript" 12 | "$TM_SUPPORT_PATH/lib/markdown_to_help.rb" "$TM_BUNDLE_PATH/README.markdown" 13 | echo "<p>Feel free to pop open the bundles guts and use the tools directly if you'd like</p>" 14 | echo "open '$TM_BUNDLE_PATH/bin/'" 15 | html_footer 16 | 17 | dontFollowNewOutput 18 | true 19 | input 20 | none 21 | name 22 | Help 23 | output 24 | showAsHTML 25 | scope 26 | source.js 27 | uuid 28 | 6298E048-4D1B-4DD2-A3F1-AB78DD181E06 29 | 30 | 31 | -------------------------------------------------------------------------------- /Support/node_modules/jstransform/node_modules/source-map/test/source-map/test-base64.js: -------------------------------------------------------------------------------- 1 | /* -*- Mode: js; js-indent-level: 2; -*- */ 2 | /* 3 | * Copyright 2011 Mozilla Foundation and contributors 4 | * Licensed under the New BSD license. See LICENSE or: 5 | * http://opensource.org/licenses/BSD-3-Clause 6 | */ 7 | if (typeof define !== 'function') { 8 | var define = require('amdefine')(module, require); 9 | } 10 | define(function (require, exports, module) { 11 | 12 | var base64 = require('../../lib/source-map/base64'); 13 | 14 | exports['test out of range encoding'] = function (assert, util) { 15 | assert.throws(function () { 16 | base64.encode(-1); 17 | }); 18 | assert.throws(function () { 19 | base64.encode(64); 20 | }); 21 | }; 22 | 23 | exports['test out of range decoding'] = function (assert, util) { 24 | assert.throws(function () { 25 | base64.decode('='); 26 | }); 27 | }; 28 | 29 | exports['test normal encoding and decoding'] = function (assert, util) { 30 | for (var i = 0; i < 64; i++) { 31 | assert.equal(base64.decode(base64.encode(i)), i); 32 | } 33 | }; 34 | 35 | }); 36 | -------------------------------------------------------------------------------- /Commands/Compress with YUI! Compressor.tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | #!/usr/bin/env bash -l 9 | source "$TM_SUPPORT_PATH/lib/bash_init.sh" # might not be necessary 10 | cat >'/tmp/compress_this_file.js'; 11 | java -jar "$TM_BUNDLE_SUPPORT/bin/yuicompressor.jar" --charset utf8 --preserve-semi '/tmp/compress_this_file.js' -o '/tmp/compress_this_file.js'; 12 | cat /tmp/compress_this_file.js; 13 | 14 | fallbackInput 15 | scope 16 | input 17 | selection 18 | keyEquivalent 19 | ^@c 20 | name 21 | Compress with YUI! Compressor 22 | output 23 | replaceSelectedText 24 | scope 25 | source.js -entity.name.tag.script.html 26 | uuid 27 | 2C4286B3-B2F3-4524-AE4B-3A2BB5CA1150 28 | 29 | 30 | -------------------------------------------------------------------------------- /Support/bin/bs.js: -------------------------------------------------------------------------------- 1 | /* 2 | --- 3 | provides : BuildSugar 4 | version : 0.1alpha1 5 | description : Provides a bizarrely clean & simple syntax sugar for building HTML/XML strings 6 | source : http://gist.github.com/278016 7 | git : git://gist.github.com/278016.git 8 | demo : http://jsfiddle.net/SubtleGradient/4W3RR/ 9 | 10 | author : Thomas Aylott 11 | site : subtlegradient.com 12 | copyright : 2010 Thomas Aylott 13 | license : MIT 14 | ... 15 | */ 16 | var BS = (function (bs) { 17 | 18 | function BS ( selector,content ) { 19 | bs .push ([]) 20 | return BS2 ( selector,content ) 21 | } 22 | 23 | function BS2 ( selector,content ) { 24 | content = ''+ ( content||'' ) 25 | 26 | selector && write ( '<',selector,'>' ) 27 | content && write ( content ) 28 | selector && write ( '' ) 29 | 30 | return BS2 31 | } 32 | 33 | BS2 .toString = function () { return bs .pop () .join ('') } 34 | 35 | function write () { bs[bs.length-1] .push (bs .join .call ( arguments,'' )) } 36 | 37 | return BS 38 | 39 | }) ([]) 40 | 41 | if (typeof exports == 'object') exports.BS = BS 42 | -------------------------------------------------------------------------------- /Commands/Compress with YUI! Compressor CSS.tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | #!/usr/bin/env bash -l 9 | source "$TM_SUPPORT_PATH/lib/bash_init.sh" # might not be necessary 10 | cat >'/tmp/compress_this_file.css'; 11 | java -jar "$TM_BUNDLE_SUPPORT/bin/yuicompressor.jar" --charset utf8 --preserve-semi --type=css '/tmp/compress_this_file.css' -o '/tmp/compress_this_file.css'; 12 | cat /tmp/compress_this_file.css; 13 | 14 | fallbackInput 15 | scope 16 | input 17 | selection 18 | keyEquivalent 19 | ^@c 20 | name 21 | Compress with YUI! Compressor CSS 22 | output 23 | replaceSelectedText 24 | scope 25 | source.css -entity.name.tag 26 | uuid 27 | 14281367-C8CB-4FE4-AD3B-E23B153F528D 28 | 29 | 30 | -------------------------------------------------------------------------------- /Support/bin/js-beautify/license.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009 Einar Lielmanis 2 | 3 | Permission is hereby granted, free of charge, to any person 4 | obtaining a copy of this software and associated documentation 5 | files (the "Software"), to deal in the Software without 6 | restriction, including without limitation the rights to use, 7 | copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the 9 | Software is furnished to do so, subject to the following 10 | conditions: 11 | 12 | The above copyright notice and this permission notice shall be 13 | included in all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 17 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 19 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 20 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 21 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | -------------------------------------------------------------------------------- /Support/node_modules/jstransform/node_modules/base62/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012 Andrew Nesbitt 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /Support/node_modules/js-beautify-node/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009 Einar Lielmanis 2 | 3 | Permission is hereby granted, free of charge, to any person 4 | obtaining a copy of this software and associated documentation 5 | files (the "Software"), to deal in the Software without 6 | restriction, including without limitation the rights to use, 7 | copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the 9 | Software is furnished to do so, subject to the following 10 | conditions: 11 | 12 | The above copyright notice and this permission notice shall be 13 | included in all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 17 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 19 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 20 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 21 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | 25 | -------------------------------------------------------------------------------- /Commands/Convert ES6.tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | #!/usr/bin/env bash -l 9 | [[ -f "${TM_SUPPORT_PATH}/lib/bash_init.sh" ]] && . "${TM_SUPPORT_PATH}/lib/bash_init.sh" 10 | 11 | require_cmd node 12 | 13 | cat | node "$TM_BUNDLE_SUPPORT/convert-es6.js" # 2>&1 |pre | "$TM_BUNDLE_SUPPORT/bin/TextMate.js" linkPaths 14 | 15 | input 16 | scope 17 | inputFormat 18 | text 19 | keyEquivalent 20 | ^H 21 | name 22 | Convert ES6 23 | outputCaret 24 | interpolateByChar 25 | outputFormat 26 | text 27 | outputLocation 28 | replaceInput 29 | scope 30 | source.js 31 | uuid 32 | 6A62379A-6DDE-4B04-B30D-629373A0F3D4 33 | version 34 | 2 35 | 36 | 37 | -------------------------------------------------------------------------------- /Commands/Run JavaScript with osascript.tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | #!/usr/bin/env bash -l 9 | source "$TM_SUPPORT_PATH/lib/bash_init.sh" # might not be necessary 10 | . "$TM_SUPPORT_PATH/lib/webpreview.sh" 11 | html_header "Run JavaScript with osascript" 12 | 13 | require_cmd osascript 14 | 15 | osascript -l JavaScript "$TM_FILEPATH" | pre 16 | 17 | html_footer 18 | 19 | input 20 | none 21 | inputFormat 22 | text 23 | keyEquivalent 24 | @r 25 | name 26 | Run JavaScript with osascript 27 | outputCaret 28 | afterOutput 29 | outputFormat 30 | html 31 | outputLocation 32 | newWindow 33 | scope 34 | attr.rev-path.js.jxa, attr.rev-path.jxa 35 | uuid 36 | AC3596B5-18C7-44E1-9AAC-7139F9CCD09A 37 | version 38 | 2 39 | 40 | 41 | -------------------------------------------------------------------------------- /Support/node_modules/jstransform/node_modules/source-map/node_modules/amdefine/intercept.js: -------------------------------------------------------------------------------- 1 | /*jshint node: true */ 2 | var inserted, 3 | Module = require('module'), 4 | fs = require('fs'), 5 | existingExtFn = Module._extensions['.js'], 6 | amdefineRegExp = /amdefine\.js/; 7 | 8 | inserted = "if (typeof define !== 'function') {var define = require('amdefine')(module)}"; 9 | 10 | //From the node/lib/module.js source: 11 | function stripBOM(content) { 12 | // Remove byte order marker. This catches EF BB BF (the UTF-8 BOM) 13 | // because the buffer-to-string conversion in `fs.readFileSync()` 14 | // translates it to FEFF, the UTF-16 BOM. 15 | if (content.charCodeAt(0) === 0xFEFF) { 16 | content = content.slice(1); 17 | } 18 | return content; 19 | } 20 | 21 | //Also adapted from the node/lib/module.js source: 22 | function intercept(module, filename) { 23 | var content = stripBOM(fs.readFileSync(filename, 'utf8')); 24 | 25 | if (!amdefineRegExp.test(module.id)) { 26 | content = inserted + content; 27 | } 28 | 29 | module._compile(content, filename); 30 | } 31 | 32 | intercept._id = 'amdefine/intercept'; 33 | 34 | if (!existingExtFn._id || existingExtFn._id !== intercept._id) { 35 | Module._extensions['.js'] = intercept; 36 | } 37 | -------------------------------------------------------------------------------- /Commands/Validate with JSHint (Quick).tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | #!/usr/bin/env bash -l 9 | [[ -f "${TM_SUPPORT_PATH}/lib/bash_init.sh" ]] && . "${TM_SUPPORT_PATH}/lib/bash_init.sh" 10 | 11 | require_cmd node 12 | 13 | cat|"${TM_NODEJS:-node}" "$TM_BUNDLE_SUPPORT/bin/jshint.textmate.js" quick 14 | 15 | fallbackInput 16 | scope 17 | input 18 | scope 19 | inputFormat 20 | text 21 | isDisabled 22 | 23 | name 24 | Validate with JSHint (Quick) 25 | outputCaret 26 | afterOutput 27 | outputFormat 28 | text 29 | outputLocation 30 | toolTip 31 | scope 32 | source.es, source.js -(meta.tag.block.script.html) 33 | semanticClass 34 | validate.quick 35 | uuid 36 | EAC536BF-6C4C-4AE9-8437-B28E8EB31631 37 | version 38 | 2 39 | 40 | 41 | -------------------------------------------------------------------------------- /Commands/Debug in Node_js Inspector.tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | #!/usr/bin/env bash -l 9 | source "$TM_SUPPORT_PATH/lib/bash_init.sh" # might not be necessary 10 | . "$TM_SUPPORT_PATH/lib/html.sh" 11 | 12 | require_cmd node 13 | require_cmd node-inspector 14 | 15 | (sleep 1; node-inspector 2>&1 >/dev/null || true) & 16 | (sleep 2; open -a 'Google Chrome' "http://0.0.0.0:8080/debug?port=5858") & 17 | 18 | node --debug-brk "$TM_FILEPATH" | pre 19 | 20 | input 21 | none 22 | inputFormat 23 | text 24 | keyEquivalent 25 | ^~@r 26 | name 27 | Debug in Node.js Inspector 28 | outputCaret 29 | afterOutput 30 | outputFormat 31 | html 32 | outputLocation 33 | newWindow 34 | scope 35 | source.js 36 | uuid 37 | FF421350-D5CD-4FB2-9FDE-D92B02CD7F73 38 | version 39 | 2 40 | 41 | 42 | -------------------------------------------------------------------------------- /Support/node_modules/jstransform/node_modules/source-map/lib/source-map/base64.js: -------------------------------------------------------------------------------- 1 | /* -*- Mode: js; js-indent-level: 2; -*- */ 2 | /* 3 | * Copyright 2011 Mozilla Foundation and contributors 4 | * Licensed under the New BSD license. See LICENSE or: 5 | * http://opensource.org/licenses/BSD-3-Clause 6 | */ 7 | if (typeof define !== 'function') { 8 | var define = require('amdefine')(module, require); 9 | } 10 | define(function (require, exports, module) { 11 | 12 | var charToIntMap = {}; 13 | var intToCharMap = {}; 14 | 15 | 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' 16 | .split('') 17 | .forEach(function (ch, index) { 18 | charToIntMap[ch] = index; 19 | intToCharMap[index] = ch; 20 | }); 21 | 22 | /** 23 | * Encode an integer in the range of 0 to 63 to a single base 64 digit. 24 | */ 25 | exports.encode = function base64_encode(aNumber) { 26 | if (aNumber in intToCharMap) { 27 | return intToCharMap[aNumber]; 28 | } 29 | throw new TypeError("Must be between 0 and 63: " + aNumber); 30 | }; 31 | 32 | /** 33 | * Decode a single base 64 digit to an integer. 34 | */ 35 | exports.decode = function base64_decode(aChar) { 36 | if (aChar in charToIntMap) { 37 | return charToIntMap[aChar]; 38 | } 39 | throw new TypeError("Not a valid base 64 digit: " + aChar); 40 | }; 41 | 42 | }); 43 | -------------------------------------------------------------------------------- /Commands/Debug with Node_js.tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | #!/usr/bin/env bash -l 9 | source "$TM_SUPPORT_PATH/lib/bash_init.sh" # might not be necessary 10 | . "$TM_SUPPORT_PATH/lib/webpreview.sh" 11 | html_header "Run JavaScript in Node.js" 12 | 13 | require_cmd node 14 | 15 | (sleep 0.2; node-inspector) & 16 | (sleep 1.2; open -a 'Google Chrome' http://127.0.0.1:8080/debug?port=5858) & 17 | 18 | node --debug-brk "$TM_FILEPATH" 2>&1 |pre | "$TM_BUNDLE_SUPPORT/bin/TextMate.js" linkPaths 19 | 20 | html_footer 21 | 22 | input 23 | selection 24 | inputFormat 25 | text 26 | keyEquivalent 27 | ^~@R 28 | name 29 | Debug with Node.js 30 | outputCaret 31 | afterOutput 32 | outputFormat 33 | html 34 | outputLocation 35 | newWindow 36 | scope 37 | source.js 38 | uuid 39 | F9046994-D105-4D83-8E23-CFB535C892A7 40 | version 41 | 2 42 | 43 | 44 | -------------------------------------------------------------------------------- /Commands/Validate with JSHint.tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | #!/usr/bin/env bash -l 9 | [[ -f "${TM_SUPPORT_PATH}/lib/bash_init.sh" ]] && . "${TM_SUPPORT_PATH}/lib/bash_init.sh" 10 | 11 | . "$TM_SUPPORT_PATH/lib/webpreview.sh" 12 | html_header "Validate Javascript" 13 | 14 | require_cmd node 15 | 16 | cat|"${TM_NODEJS:-node}" "$TM_BUNDLE_SUPPORT/bin/jshint.textmate.js" 17 | # |sed 's/&/&amp;/g'|sed 's/</&gt;/g'|pre 18 | 19 | html_footer 20 | 21 | fallbackInput 22 | scope 23 | input 24 | scope 25 | inputFormat 26 | text 27 | keyEquivalent 28 | ^V 29 | name 30 | Validate with JSHint 31 | outputCaret 32 | afterOutput 33 | outputFormat 34 | html 35 | outputLocation 36 | newWindow 37 | scope 38 | source.es, source.js -(meta.tag.block.script.html) 39 | uuid 40 | 7C7E733F-D008-4A52-8A2C-7552836807C1 41 | version 42 | 2 43 | 44 | 45 | -------------------------------------------------------------------------------- /Commands/Reformat with JS Beautifier (Rhino).tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | #!/usr/bin/env bash -l 9 | [[ -f "${TM_SUPPORT_PATH}/lib/bash_init.sh" ]] && . "${TM_SUPPORT_PATH}/lib/bash_init.sh" 10 | 11 | cat > /tmp/reformat_this_file.js 12 | cd "$TM_BUNDLE_SUPPORT/bin/js-beautify/" 13 | 14 | INDENT="1" 15 | if [ $TM_SOFT_TABS = YES ]; then 16 | INDENT="$TM_TAB_SIZE" 17 | fi 18 | 19 | java -jar ../js.jar beautify-cl.js -n -i "$INDENT" /tmp/reformat_this_file.js 2>&1 20 | 21 | fallbackInput 22 | scope 23 | input 24 | selection 25 | inputFormat 26 | text 27 | keyEquivalent 28 | ^H 29 | name 30 | Reformat with JS Beautifier (Rhino) 31 | outputCaret 32 | heuristic 33 | outputFormat 34 | text 35 | outputLocation 36 | replaceInput 37 | scope 38 | source.js -entity.name.tag.script.html 39 | uuid 40 | 0C3CB37C-1C88-4F62-814B-5C6998E1709B 41 | version 42 | 2 43 | 44 | 45 | -------------------------------------------------------------------------------- /Commands/Reformat with JS Beautifier (Node_js).tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | #!/usr/bin/env bash -l 9 | [[ -f "${TM_SUPPORT_PATH}/lib/bash_init.sh" ]] && . "${TM_SUPPORT_PATH}/lib/bash_init.sh" 10 | 11 | cat > /tmp/reformat_this_file.js 12 | 13 | require_cmd node 14 | 15 | INDENT="1" 16 | if [ $TM_SOFT_TABS = YES ]; then 17 | INDENT="$TM_TAB_SIZE" 18 | fi 19 | 20 | node "$TM_BUNDLE_SUPPORT/node_modules/js-beautify-node/beautify-node.js" -n -i "$INDENT" /tmp/reformat_this_file.js 2>&1 21 | 22 | fallbackInput 23 | scope 24 | input 25 | selection 26 | inputFormat 27 | text 28 | keyEquivalent 29 | ^H 30 | name 31 | Reformat with JS Beautifier (Node.js) 32 | outputCaret 33 | heuristic 34 | outputFormat 35 | text 36 | outputLocation 37 | replaceInput 38 | scope 39 | source.js -entity.name.tag.script.html 40 | uuid 41 | 91A87FF2-F802-4999-98ED-4FEFC3465AC1 42 | version 43 | 2 44 | 45 | 46 | -------------------------------------------------------------------------------- /Support/node_modules/jstransform/node_modules/source-map/build/assert-shim.js: -------------------------------------------------------------------------------- 1 | /* -*- Mode: js; js-indent-level: 2; -*- */ 2 | /* 3 | * Copyright 2011 Mozilla Foundation and contributors 4 | * Licensed under the New BSD license. See LICENSE or: 5 | * http://opensource.org/licenses/BSD-3-Clause 6 | */ 7 | define('test/source-map/assert', ['exports'], function (exports) { 8 | 9 | let do_throw = function (msg) { 10 | throw new Error(msg); 11 | }; 12 | 13 | exports.init = function (throw_fn) { 14 | do_throw = throw_fn; 15 | }; 16 | 17 | exports.doesNotThrow = function (fn) { 18 | try { 19 | fn(); 20 | } 21 | catch (e) { 22 | do_throw(e.message); 23 | } 24 | }; 25 | 26 | exports.equal = function (actual, expected, msg) { 27 | msg = msg || String(actual) + ' != ' + String(expected); 28 | if (actual != expected) { 29 | do_throw(msg); 30 | } 31 | }; 32 | 33 | exports.ok = function (val, msg) { 34 | msg = msg || String(val) + ' is falsey'; 35 | if (!Boolean(val)) { 36 | do_throw(msg); 37 | } 38 | }; 39 | 40 | exports.strictEqual = function (actual, expected, msg) { 41 | msg = msg || String(actual) + ' !== ' + String(expected); 42 | if (actual !== expected) { 43 | do_throw(msg); 44 | } 45 | }; 46 | 47 | exports.throws = function (fn) { 48 | try { 49 | fn(); 50 | do_throw('Expected an error to be thrown, but it wasn\'t.'); 51 | } 52 | catch (e) { 53 | } 54 | }; 55 | 56 | }); 57 | -------------------------------------------------------------------------------- /Support/bin/js-beautify/bin/beautify_js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/ruby 2 | 3 | def print_usage 4 | puts <,!#{$0} 17 | 18 | Then you can simply type BeautifyJavascript to process the entire buffer or select a range of lines to only pass those lines through the filter. 19 | End 20 | exit 21 | end 22 | 23 | 24 | if STDIN.tty? 25 | if ARGV.size >= 1 26 | # Get the absolute path of the filename given 27 | require 'pathname' 28 | path = Pathname.new(ARGV[0]).realpath.to_s 29 | else 30 | print_usage 31 | end 32 | else 33 | # Assume they are piping the input in. Save that input in a temporary file and pass that file to beautify-cl.js 34 | require 'tempfile' 35 | file = Tempfile.new('beautify_js') 36 | file.puts STDIN.read 37 | file.close 38 | path = file.path 39 | end 40 | #system "cat #{path}" 41 | 42 | 43 | # Change directory so that the load() calls in beautify-cl.js are able to find the files they need 44 | Dir.chdir File.dirname(__FILE__) 45 | Dir.chdir '..' 46 | #puts Dir.getwd 47 | 48 | 49 | command = "java -jar ../js.jar beautify-cl.js '#{path}' 2>&1" 50 | #puts command 51 | #output = `#{command}` 52 | system command 53 | 54 | -------------------------------------------------------------------------------- /Support/node_modules/jstransform/node_modules/source-map/LICENSE: -------------------------------------------------------------------------------- 1 | 2 | Copyright (c) 2009-2011, Mozilla Foundation and contributors 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are met: 7 | 8 | * Redistributions of source code must retain the above copyright notice, this 9 | list of conditions and the following disclaimer. 10 | 11 | * Redistributions in binary form must reproduce the above copyright notice, 12 | this list of conditions and the following disclaimer in the documentation 13 | and/or other materials provided with the distribution. 14 | 15 | * Neither the names of the Mozilla Foundation nor the names of project 16 | contributors may be used to endorse or promote products derived from this 17 | software without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 20 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 21 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 22 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 23 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 25 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 26 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 27 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | -------------------------------------------------------------------------------- /Support/node_modules/js-beautify-node/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "js-beautify-node", 3 | "description": "Javascript beautifier. Working on node'ifying it.", 4 | "tags": [ 5 | "js", 6 | "javascript", 7 | "beautifier", 8 | "indentation", 9 | "dumper", 10 | "serialize", 11 | "node" 12 | ], 13 | "version": "1.0.0", 14 | "author": { 15 | "name": "Gregor Schwab", 16 | "email": "mail@synaptic-labs.net", 17 | "url": "www.grenzgenial.com" 18 | }, 19 | "repository": { 20 | "type": "git", 21 | "url": "https://github.com/dotmaster/js-beautify-node" 22 | }, 23 | "bugs": { 24 | "url": "https://github.com/dotmaster/js-beautify-node/issues" 25 | }, 26 | "engines": [ 27 | "node >= 0.3.0" 28 | ], 29 | "main": "beautify-node.js", 30 | "license": "MIT License (see License)", 31 | "dependencies": {}, 32 | "bin": { 33 | "jsbeautify": "./beautify-node.js" 34 | }, 35 | "readme": "# JS Beautifier, node.js version\n\nA fork of\n[github.com/carlo/js-beautify-node](https://github.com/carlo/js-beautify-node to make\nit run as a command line utility\n\n\n## Usage\n\nBeautify from the command line:\n\n jsbeautify [options] [file || URL || STDIN]\n\n\n## Requirements\n\n* node.js\n\n\n## Acknowledgements\n\n- The original [JS Beautifier](http://github.com/einars/js-beautify) from [Einar Lielmanis](mailto:einar@jsbeautifier.org). \n- [JS Beautifier Node](https://github.com/carlo/js-beautify-node\n\n\n## License\n\nMIT-License, see `LICENSE.txt`.\n", 36 | "readmeFilename": "README.markdown", 37 | "homepage": "https://github.com/dotmaster/js-beautify-node", 38 | "_id": "js-beautify-node@1.0.0", 39 | "_from": "js-beautify-node@" 40 | } 41 | -------------------------------------------------------------------------------- /Support/convert-es6.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | var transform = require('jstransform').transform; 4 | 5 | getINPUT(function(error, code){ 6 | process.stdout.write( 7 | transform( 8 | ( 9 | [] 10 | .concat(require('jstransform/visitors/type-syntax').visitorList) 11 | .concat(require('jstransform/visitors/es6-arrow-function-visitors').visitorList) 12 | .concat(require('jstransform/visitors/es6-object-concise-method-visitors').visitorList) 13 | .concat(require('jstransform/visitors/es6-object-short-notation-visitors').visitorList) 14 | .concat(require('jstransform/visitors/es6-class-visitors').visitorList) 15 | .concat(require('jstransform/visitors/es6-rest-param-visitors').visitorList) 16 | .concat(require('jstransform/visitors/es6-template-visitors').visitorList) 17 | .concat(require('jstransform/visitors/es6-destructuring-visitors').visitorList) 18 | .concat(require('jstransform/visitors/es6-call-spread-visitors').visitorList) 19 | .concat(require('jstransform/visitors/es7-spread-property-visitors').visitorList) 20 | ), 21 | code.replace(/^#/gm,'//HASH//#') 22 | ).code.replace(/\/\/HASH\/\//g,'') 23 | ); 24 | }); 25 | 26 | ///////////////////////////////////////////////////////////////////////////////// 27 | 28 | function getINPUT(callback){ 29 | var INPUT = []; 30 | process.stdin.setEncoding('utf8'); 31 | process.stdin.on('readable', function() { 32 | var chunk = process.stdin.read(); 33 | if (chunk !== null) { 34 | INPUT.push(chunk); 35 | } 36 | }); 37 | process.stdin.on('end', function() { 38 | callback(null, INPUT.join('')); 39 | }); 40 | } 41 | -------------------------------------------------------------------------------- /Commands/Run in Node_js.tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | #!/usr/bin/env bash -l 9 | [[ -f "${TM_SUPPORT_PATH}/lib/bash_init.sh" ]] && . "${TM_SUPPORT_PATH}/lib/bash_init.sh" 10 | 11 | . "$TM_SUPPORT_PATH/lib/webpreview.sh" 12 | html_header "Run JavaScript in Node.js" 13 | 14 | require_cmd node 15 | 16 | cd "$(dirname "$TM_FILEPATH")" 17 | TEST_FILEPATH="$TM_FILEPATH.TextMate_JavaScript_Tools" 18 | rm "$TEST_FILEPATH" &> /dev/null 19 | 20 | cat |grep -vE '^#' | node "$TM_BUNDLE_SUPPORT/convert-es6.js" > "$TEST_FILEPATH" 2> "$TMPDIR/error.log" 21 | cat "$TMPDIR/error.log" | pre | "$TM_BUNDLE_SUPPORT/bin/TextMate.js" linkPaths 22 | 23 | node --harmony "$TEST_FILEPATH" 2>&1 | pre | "$TM_BUNDLE_SUPPORT/bin/TextMate.js" linkPaths 24 | 25 | rm "$TEST_FILEPATH" &> /dev/null 26 | html_footer 27 | 28 | input 29 | scope 30 | inputFormat 31 | text 32 | keyEquivalent 33 | ~@r 34 | name 35 | Run in Node.js 36 | outputCaret 37 | afterOutput 38 | outputFormat 39 | html 40 | outputLocation 41 | newWindow 42 | scope 43 | source.es, source.js 44 | uuid 45 | A2A911D2-4D18-47CF-8E2D-FCDAD3006A1A 46 | version 47 | 2 48 | 49 | 50 | -------------------------------------------------------------------------------- /Support/node_modules/jstransform/visitors/es6-object-short-notation-visitors.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2013 Facebook, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /*jslint node: true*/ 18 | 19 | /** 20 | * Desugars ES6 Object Literal short notations into ES3 full notation. 21 | * 22 | * // Easier return values. 23 | * function foo(x, y) { 24 | * return {x, y}; // {x: x, y: y} 25 | * }; 26 | * 27 | * // Destructuring. 28 | * function init({port, ip, coords: {x, y}}) { ... } 29 | * 30 | */ 31 | var Syntax = require('esprima-fb').Syntax; 32 | var utils = require('../src/utils'); 33 | 34 | /** 35 | * @public 36 | */ 37 | function visitObjectLiteralShortNotation(traverse, node, path, state) { 38 | utils.catchup(node.key.range[1], state); 39 | utils.append(':' + node.key.name, state); 40 | return false; 41 | } 42 | 43 | visitObjectLiteralShortNotation.test = function(node, path, state) { 44 | return node.type === Syntax.Property && 45 | node.kind === 'init' && 46 | node.shorthand === true && 47 | path[0].type !== Syntax.ObjectPattern; 48 | }; 49 | 50 | exports.visitorList = [ 51 | visitObjectLiteralShortNotation 52 | ]; 53 | 54 | -------------------------------------------------------------------------------- /Support/node_modules/jstransform/visitors/reserved-words-helper.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014 Facebook, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | var KEYWORDS = [ 18 | 'break', 'do', 'in', 'typeof', 'case', 'else', 'instanceof', 'var', 'catch', 19 | 'export', 'new', 'void', 'class', 'extends', 'return', 'while', 'const', 20 | 'finally', 'super', 'with', 'continue', 'for', 'switch', 'yield', 'debugger', 21 | 'function', 'this', 'default', 'if', 'throw', 'delete', 'import', 'try' 22 | ]; 23 | 24 | var FUTURE_RESERVED_WORDS = [ 25 | 'enum', 'await', 'implements', 'package', 'protected', 'static', 'interface', 26 | 'private', 'public' 27 | ]; 28 | 29 | var LITERALS = [ 30 | 'null', 31 | 'true', 32 | 'false' 33 | ]; 34 | 35 | // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-reserved-words 36 | var RESERVED_WORDS = [].concat( 37 | KEYWORDS, 38 | FUTURE_RESERVED_WORDS, 39 | LITERALS 40 | ); 41 | 42 | var reservedWordsMap = Object.create(null); 43 | RESERVED_WORDS.forEach(function(k) { 44 | reservedWordsMap[k] = true; 45 | }); 46 | 47 | exports.isReservedWord = function(word) { 48 | return !!reservedWordsMap[word]; 49 | }; 50 | -------------------------------------------------------------------------------- /Support/node_modules/jstransform/node_modules/source-map/test/source-map/test-binary-search.js: -------------------------------------------------------------------------------- 1 | /* -*- Mode: js; js-indent-level: 2; -*- */ 2 | /* 3 | * Copyright 2011 Mozilla Foundation and contributors 4 | * Licensed under the New BSD license. See LICENSE or: 5 | * http://opensource.org/licenses/BSD-3-Clause 6 | */ 7 | if (typeof define !== 'function') { 8 | var define = require('amdefine')(module, require); 9 | } 10 | define(function (require, exports, module) { 11 | 12 | var binarySearch = require('../../lib/source-map/binary-search'); 13 | 14 | function numberCompare(a, b) { 15 | return a - b; 16 | } 17 | 18 | exports['test too high'] = function (assert, util) { 19 | var needle = 30; 20 | var haystack = [2,4,6,8,10,12,14,16,18,20]; 21 | 22 | assert.doesNotThrow(function () { 23 | binarySearch.search(needle, haystack, numberCompare); 24 | }); 25 | 26 | assert.equal(binarySearch.search(needle, haystack, numberCompare), 20); 27 | }; 28 | 29 | exports['test too low'] = function (assert, util) { 30 | var needle = 1; 31 | var haystack = [2,4,6,8,10,12,14,16,18,20]; 32 | 33 | assert.doesNotThrow(function () { 34 | binarySearch.search(needle, haystack, numberCompare); 35 | }); 36 | 37 | assert.equal(binarySearch.search(needle, haystack, numberCompare), null); 38 | }; 39 | 40 | exports['test exact search'] = function (assert, util) { 41 | var needle = 4; 42 | var haystack = [2,4,6,8,10,12,14,16,18,20]; 43 | 44 | assert.equal(binarySearch.search(needle, haystack, numberCompare), 4); 45 | }; 46 | 47 | exports['test fuzzy search'] = function (assert, util) { 48 | var needle = 19; 49 | var haystack = [2,4,6,8,10,12,14,16,18,20]; 50 | 51 | assert.equal(binarySearch.search(needle, haystack, numberCompare), 18); 52 | }; 53 | 54 | }); 55 | -------------------------------------------------------------------------------- /Support/node_modules/jstransform/polyfill/Object.es6.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014 Facebook, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | * @provides Object.es6 17 | * @polyfill 18 | */ 19 | 20 | // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.assign 21 | 22 | if (!Object.assign) { 23 | Object.assign = function(target, sources) { 24 | if (target === null || target === undefined) { 25 | throw new TypeError('Object.assign target cannot be null or undefined'); 26 | } 27 | 28 | var to = Object(target); 29 | var hasOwnProperty = Object.prototype.hasOwnProperty; 30 | 31 | for (var nextIndex = 1; nextIndex < arguments.length; nextIndex++) { 32 | var nextSource = arguments[nextIndex]; 33 | if (nextSource === null || nextSource === undefined) { 34 | continue; 35 | } 36 | 37 | var from = Object(nextSource); 38 | 39 | // We don't currently support accessors nor proxies. Therefore this 40 | // copy cannot throw. If we ever supported this then we must handle 41 | // exceptions and side-effects. 42 | 43 | for (var key in from) { 44 | if (hasOwnProperty.call(from, key)) { 45 | to[key] = from[key]; 46 | } 47 | } 48 | } 49 | 50 | return to; 51 | }; 52 | } 53 | -------------------------------------------------------------------------------- /Support/node_modules/jstransform/node_modules/source-map/test/run-tests.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | /* -*- Mode: js; js-indent-level: 2; -*- */ 3 | /* 4 | * Copyright 2011 Mozilla Foundation and contributors 5 | * Licensed under the New BSD license. See LICENSE or: 6 | * http://opensource.org/licenses/BSD-3-Clause 7 | */ 8 | var assert = require('assert'); 9 | var fs = require('fs'); 10 | var path = require('path'); 11 | var util = require('./source-map/util'); 12 | 13 | function run(tests) { 14 | var failures = []; 15 | var total = 0; 16 | var passed = 0; 17 | 18 | for (var i = 0; i < tests.length; i++) { 19 | for (var k in tests[i].testCase) { 20 | if (/^test/.test(k)) { 21 | total++; 22 | try { 23 | tests[i].testCase[k](assert, util); 24 | passed++; 25 | } 26 | catch (e) { 27 | console.log('FAILED ' + tests[i].name + ': ' + k + '!'); 28 | console.log(e.stack); 29 | } 30 | } 31 | } 32 | } 33 | 34 | console.log(""); 35 | console.log(passed + ' / ' + total + ' tests passed.'); 36 | console.log(""); 37 | 38 | failures.forEach(function (f) { 39 | }); 40 | 41 | return failures.length; 42 | } 43 | 44 | var code; 45 | 46 | process.stdout.on('close', function () { 47 | process.exit(code); 48 | }); 49 | 50 | function isTestFile(f) { 51 | var testToRun = process.argv[2]; 52 | return testToRun 53 | ? path.basename(testToRun) === f 54 | : /^test\-.*?\.js/.test(f); 55 | } 56 | 57 | function toModule(f) { 58 | return './source-map/' + f.replace(/\.js$/, ''); 59 | } 60 | 61 | var requires = fs.readdirSync(path.join(__dirname, 'source-map')) 62 | .filter(isTestFile) 63 | .map(toModule); 64 | 65 | code = run(requires.map(require).map(function (mod, i) { 66 | return { 67 | name: requires[i], 68 | testCase: mod 69 | }; 70 | })); 71 | process.exit(code); 72 | -------------------------------------------------------------------------------- /Support/bin/packr-1.0.2/lib/packr/words.rb: -------------------------------------------------------------------------------- 1 | class Packr 2 | class Words 3 | 4 | WORDS = /\w+/ 5 | attr_accessor :words 6 | 7 | def initialize(script) 8 | script.to_s.scan(WORDS).each { |word| add(word) } 9 | encode! 10 | end 11 | 12 | def add(word) 13 | @words ||= [] 14 | @words << (stored_word = Item.new(word)) unless stored_word = get(word) 15 | word = stored_word 16 | word.count = word.count + 1 17 | word 18 | end 19 | 20 | def get(word) 21 | @words.find { |w| w.word == word.to_s } 22 | end 23 | 24 | def has?(word) 25 | !!(get word) 26 | end 27 | 28 | def size 29 | @words.size 30 | end 31 | 32 | def to_s 33 | @words.join("|") 34 | end 35 | 36 | private 37 | 38 | def encode! 39 | # sort by frequency 40 | @words = @words.sort_by { |word| word.count }.reverse 41 | 42 | a = 62 43 | e = lambda do |c| 44 | (c < a ? '' : e.call((c.to_f / a).to_i) ) + 45 | ((c = c % a) > 35 ? (c+29).chr : c.to_s(36)) 46 | end 47 | 48 | # a dictionary of base62 -> base10 49 | encoded = (0...(@words.size)).map { |i| e.call(i) } 50 | 51 | index = 0 52 | @words.each do |word| 53 | if x = encoded.index(word.word) 54 | word.index = x 55 | def word.to_s; ""; end 56 | else 57 | index += 1 while has?(e.call(index)) 58 | word.index = index 59 | index += 1 60 | end 61 | word.encoded = e.call(word.index) 62 | end 63 | 64 | # sort by encoding 65 | @words = @words.sort_by { |word| word.index } 66 | end 67 | 68 | class Item 69 | attr_accessor :word, :count, :encoded, :index 70 | 71 | def initialize(word) 72 | @word = word 73 | @count = 0 74 | @encoded = "" 75 | @index = -1 76 | end 77 | 78 | def to_s 79 | @word 80 | end 81 | end 82 | 83 | end 84 | end 85 | -------------------------------------------------------------------------------- /Support/node_modules/jstransform/visitors/es6-object-concise-method-visitors.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2013 Facebook, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /*jslint node:true*/ 18 | 19 | /** 20 | * Desugars concise methods of objects to function expressions. 21 | * 22 | * var foo = { 23 | * method(x, y) { ... } 24 | * }; 25 | * 26 | * var foo = { 27 | * method: function(x, y) { ... } 28 | * }; 29 | * 30 | */ 31 | 32 | var Syntax = require('esprima-fb').Syntax; 33 | var utils = require('../src/utils'); 34 | var reservedWordsHelper = require('./reserved-words-helper'); 35 | 36 | function visitObjectConciseMethod(traverse, node, path, state) { 37 | var isGenerator = node.value.generator; 38 | if (isGenerator) { 39 | utils.catchupWhiteSpace(node.range[0] + 1, state); 40 | } 41 | if (node.computed) { // []() { ...} 42 | utils.catchup(node.key.range[1] + 1, state); 43 | } else if (reservedWordsHelper.isReservedWord(node.key.name)) { 44 | utils.catchup(node.key.range[0], state); 45 | utils.append('"', state); 46 | utils.catchup(node.key.range[1], state); 47 | utils.append('"', state); 48 | } 49 | 50 | utils.catchup(node.key.range[1], state); 51 | utils.append( 52 | ':function' + (isGenerator ? '*' : ''), 53 | state 54 | ); 55 | path.unshift(node); 56 | traverse(node.value, path, state); 57 | path.shift(); 58 | return false; 59 | } 60 | 61 | visitObjectConciseMethod.test = function(node, path, state) { 62 | return node.type === Syntax.Property && 63 | node.value.type === Syntax.FunctionExpression && 64 | node.method === true; 65 | }; 66 | 67 | exports.visitorList = [ 68 | visitObjectConciseMethod 69 | ]; 70 | -------------------------------------------------------------------------------- /Support/node_modules/jstransform/node_modules/base62/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": { 3 | "name": "Andrew Nesbitt", 4 | "email": "andrewnez@gmail.com", 5 | "url": "http://andrew-nesbitt.com/" 6 | }, 7 | "name": "base62", 8 | "description": "Javascript Base62 encode/decoder", 9 | "keywords": [ 10 | "base-62" 11 | ], 12 | "version": "0.1.1", 13 | "repository": { 14 | "type": "git", 15 | "url": "git://github.com/andrew/base62.js.git" 16 | }, 17 | "main": "base62.js", 18 | "engines": { 19 | "node": "*" 20 | }, 21 | "scripts": { 22 | "test": "mocha test" 23 | }, 24 | "devDependencies": { 25 | "mocha": "1.7.x" 26 | }, 27 | "_id": "base62@0.1.1", 28 | "dist": { 29 | "shasum": "7b4174c2f94449753b11c2651c083da841a7b084", 30 | "tarball": "http://registry.npmjs.org/base62/-/base62-0.1.1.tgz" 31 | }, 32 | "_npmVersion": "1.1.65", 33 | "_npmUser": { 34 | "name": "andrewnez", 35 | "email": "andrewnez@gmail.com" 36 | }, 37 | "maintainers": [ 38 | { 39 | "name": "andrewnez", 40 | "email": "andrewnez@gmail.com" 41 | } 42 | ], 43 | "directories": {}, 44 | "_shasum": "7b4174c2f94449753b11c2651c083da841a7b084", 45 | "_from": "base62@0.1.1", 46 | "_resolved": "https://registry.npmjs.org/base62/-/base62-0.1.1.tgz", 47 | "readme": "# Base62.js \n[![build status](https://secure.travis-ci.org/andrew/base62.js.png)](http://travis-ci.org/andrew/base62.js)\n\nA javascript Base62 encode/decoder for node.js\n\n## Install\n\n npm install base62\n\n## Usage\n\n Base62 = require('base62')\n Base62.encode(999) // 'g7'\n Base62.decode('g7') // 999\n\n## Development\n\nSource hosted at [GitHub](http://github.com/andrew/base62.js).\nReport Issues/Feature requests on [GitHub Issues](http://github.com/andrew/split/base62.js).\n\n### Note on Patches/Pull Requests\n\n * Fork the project.\n * Make your feature addition or bug fix.\n * Add tests for it. This is important so I don't break it in a future version unintentionally.\n * Send me a pull request. Bonus points for topic branches.\n\n## Copyright\n\nCopyright (c) 2012 Andrew Nesbitt. See [LICENSE](https://github.com/andrew/base62.js/blob/master/LICENSE) for details.\n", 48 | "readmeFilename": "Readme.md", 49 | "bugs": { 50 | "url": "https://github.com/andrew/base62.js/issues" 51 | }, 52 | "homepage": "https://github.com/andrew/base62.js" 53 | } 54 | -------------------------------------------------------------------------------- /Support/node_modules/jstransform/visitors/reserved-words-visitors.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014 Facebook, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | /*global exports:true*/ 18 | 19 | var Syntax = require('esprima-fb').Syntax; 20 | var utils = require('../src/utils'); 21 | var reserverdWordsHelper = require('./reserved-words-helper'); 22 | 23 | /** 24 | * Code adapted from https://github.com/spicyj/es3ify 25 | * The MIT License (MIT) 26 | * Copyright (c) 2014 Ben Alpert 27 | */ 28 | 29 | function visitProperty(traverse, node, path, state) { 30 | utils.catchup(node.key.range[0], state); 31 | utils.append('"', state); 32 | utils.catchup(node.key.range[1], state); 33 | utils.append('"', state); 34 | utils.catchup(node.value.range[0], state); 35 | traverse(node.value, path, state); 36 | return false; 37 | } 38 | 39 | visitProperty.test = function(node) { 40 | return node.type === Syntax.Property && 41 | node.key.type === Syntax.Identifier && 42 | !node.method && 43 | !node.shorthand && 44 | !node.computed && 45 | reserverdWordsHelper.isReservedWord(node.key.name); 46 | }; 47 | 48 | function visitMemberExpression(traverse, node, path, state) { 49 | traverse(node.object, path, state); 50 | utils.catchup(node.property.range[0] - 1, state); 51 | utils.append('[', state); 52 | utils.catchupWhiteSpace(node.property.range[0], state); 53 | utils.append('"', state); 54 | utils.catchup(node.property.range[1], state); 55 | utils.append('"]', state); 56 | return false; 57 | } 58 | 59 | visitMemberExpression.test = function(node) { 60 | return node.type === Syntax.MemberExpression && 61 | node.property.type === Syntax.Identifier && 62 | reserverdWordsHelper.isReservedWord(node.property.name); 63 | }; 64 | 65 | exports.visitorList = [ 66 | visitProperty, 67 | visitMemberExpression 68 | ]; 69 | -------------------------------------------------------------------------------- /Support/node_modules/jstransform/node_modules/esprima-fb/README.md: -------------------------------------------------------------------------------- 1 | **Esprima** ([esprima.org](http://esprima.org), BSD license) is a high performance, 2 | standard-compliant [ECMAScript](http://www.ecma-international.org/publications/standards/Ecma-262.htm) 3 | parser written in ECMAScript (also popularly known as 4 | [JavaScript](http://en.wikipedia.org/wiki/JavaScript>JavaScript)). 5 | Esprima is created and maintained by [Ariya Hidayat](http://twitter.com/ariyahidayat), 6 | with the help of [many contributors](https://github.com/ariya/esprima/contributors). 7 | 8 | **Esprima-FB** is a fork of the [Harmony branch](https://github.com/ariya/esprima/tree/harmony) of Esprima that implements [JSX specification](https://github.com/facebook/jsx) on top of ECMAScript syntax. 9 | 10 | ### Features 11 | 12 | - Full support for ECMAScript 5.1 ([ECMA-262](http://www.ecma-international.org/publications/standards/Ecma-262.htm)) 13 | - Experimental support for ES6/Harmony (module, class, destructuring, ...) 14 | - Full support for [JSX syntax extensions](https://github.com/facebook/jsx). 15 | - Sensible [syntax tree format](https://github.com/facebook/jsx/blob/master/AST.md) compatible with Mozilla 16 | [Parser AST](https://developer.mozilla.org/en/SpiderMonkey/Parser_API) 17 | - Optional tracking of syntax node location (index-based and line-column) 18 | - Heavily tested (> 650 [unit tests](http://esprima.org/test/) with [full code coverage](http://esprima.org/test/coverage.html)) 19 | - Ongoing support for ES6/Harmony (module, class, destructuring, ...) 20 | 21 | ### Versioning rules 22 | 23 | In order to follow semver rules and keep reference to original Esprima versions at the same time, we left 3 digits of each version part to refer to upstream harmony branch. We then take the most significant digit. 24 | 25 | **Example:** 4001.3001.0000-dev-harmony-fb aligns with 1.1.0-dev-harmony (aka 001.001.000-dev-harmony) in upstream, with our own changes on top. 26 | 27 | Esprima-FB serves as a **building block** for JSX language tools and transpiler implementations (such as [React](https://github.com/facebook/react) or [JSXDOM](https://github.com/vjeux/jsxdom)). 28 | 29 | Esprima-FB runs on many popular web browsers, as well as other ECMAScript platforms such as 30 | [Rhino](http://www.mozilla.org/rhino) and [Node.js](https://npmjs.org/package/esprima). 31 | 32 | For more information on original Esprima, check the web site [esprima.org](http://esprima.org). 33 | -------------------------------------------------------------------------------- /Commands/Run with Photoshop.tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | #!/usr/bin/env bash -l 9 | source "$TM_SUPPORT_PATH/lib/bash_init.sh" # might not be necessary 10 | . "$TM_SUPPORT_PATH/lib/webpreview.sh" 11 | html_header "Run JavaScript in Photoshop" 12 | 13 | require_cmd osascript 14 | 15 | TARGET_FILE="$TM_FILEPATH.TextMate_Run_with_Photoshop.jsx" 16 | 17 | stdout_fifo="${TMPDIR}photoshop-$$-stdout" 18 | stderr_fifo="${TMPDIR}photoshop-$$-stderr" 19 | # stdin_fifo="${TMPDIR}photoshop-$$-stdin" 20 | 21 | rm -f "$stdout_fifo" 22 | rm -f "$stderr_fifo" 23 | # rm -f "$stdin_fifo" 24 | 25 | mkfifo "$stdout_fifo" 26 | mkfifo "$stderr_fifo" 27 | # mkfifo "$stdin_fifo" 28 | 29 | cat "$stdout_fifo" > /dev/stdout & 30 | cat "$stderr_fifo" > /dev/stderr & 31 | # cat /dev/stdin > "$stderr_fifo" & 32 | 33 | echo "#target photoshop 34 | 35 | __stdout__ = new File('$stdout_fifo') 36 | __stdout__.open('w') 37 | $.write = function(){return __stdout__.write.apply(__stdout__, arguments)} 38 | print = $.writeln = function(){return __stdout__.writeln.apply(__stdout__, arguments)} 39 | 40 | __stderr__ = new File('$stderr_fifo') 41 | __stderr__.open('w') 42 | 43 | try{ 44 | #include '$TM_FILEPATH' 45 | }catch(e){ 46 | __stderr__.write(e + '\n') 47 | } 48 | " >> "$TARGET_FILE" 49 | 50 | osascript \ 51 | -e 'on run argv' \ 52 | -e 'tell application "Adobe Photoshop CC 2014" to do javascript (item 1 of argv) -- show debugger on runtime error' \ 53 | -e 'end run' \ 54 | "#include '$TARGET_FILE'" | pre 55 | 56 | html_footer 57 | 58 | rm "$stdout_fifo" 59 | rm "$stderr_fifo" 60 | # rm "$stdin_fifo" 61 | 62 | rm "$TARGET_FILE" 63 | 64 | input 65 | scope 66 | inputFormat 67 | text 68 | keyEquivalent 69 | @r 70 | name 71 | Run with Photoshop 72 | outputCaret 73 | afterOutput 74 | outputFormat 75 | html 76 | outputLocation 77 | newWindow 78 | scope 79 | source.js attr.rev-path.jsx, source.js attr.rev-path.jsxinc 80 | uuid 81 | EE765E53-0D8B-4F4C-8560-5840506CB9E9 82 | version 83 | 2 84 | 85 | 86 | -------------------------------------------------------------------------------- /Support/node_modules/jstransform/src/docblock.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2013 Facebook, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | var docblockRe = /^\s*(\/\*\*(.|\r?\n)*?\*\/)/; 18 | var ltrimRe = /^\s*/; 19 | /** 20 | * @param {String} contents 21 | * @return {String} 22 | */ 23 | function extract(contents) { 24 | var match = contents.match(docblockRe); 25 | if (match) { 26 | return match[0].replace(ltrimRe, '') || ''; 27 | } 28 | return ''; 29 | } 30 | 31 | 32 | var commentStartRe = /^\/\*\*?/; 33 | var commentEndRe = /\*+\/$/; 34 | var wsRe = /[\t ]+/g; 35 | var stringStartRe = /(\r?\n|^) *\*/g; 36 | var multilineRe = /(?:^|\r?\n) *(@[^\r\n]*?) *\r?\n *([^@\r\n\s][^@\r\n]+?) *\r?\n/g; 37 | var propertyRe = /(?:^|\r?\n) *@(\S+) *([^\r\n]*)/g; 38 | 39 | /** 40 | * @param {String} contents 41 | * @return {Array} 42 | */ 43 | function parse(docblock) { 44 | docblock = docblock 45 | .replace(commentStartRe, '') 46 | .replace(commentEndRe, '') 47 | .replace(wsRe, ' ') 48 | .replace(stringStartRe, '$1'); 49 | 50 | // Normalize multi-line directives 51 | var prev = ''; 52 | while (prev != docblock) { 53 | prev = docblock; 54 | docblock = docblock.replace(multilineRe, "\n$1 $2\n"); 55 | } 56 | docblock = docblock.trim(); 57 | 58 | var result = []; 59 | var match; 60 | while (match = propertyRe.exec(docblock)) { 61 | result.push([match[1], match[2]]); 62 | } 63 | 64 | return result; 65 | } 66 | 67 | /** 68 | * Same as parse but returns an object of prop: value instead of array of paris 69 | * If a property appers more than once the last one will be returned 70 | * 71 | * @param {String} contents 72 | * @return {Object} 73 | */ 74 | function parseAsObject(docblock) { 75 | var pairs = parse(docblock); 76 | var result = {}; 77 | for (var i = 0; i < pairs.length; i++) { 78 | result[pairs[i][0]] = pairs[i][1]; 79 | } 80 | return result; 81 | } 82 | 83 | 84 | exports.extract = extract; 85 | exports.parse = parse; 86 | exports.parseAsObject = parseAsObject; 87 | -------------------------------------------------------------------------------- /Support/node_modules/jstransform/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jstransform", 3 | "version": "9.1.1", 4 | "description": "A simple AST visitor-based JS transformer", 5 | "contributors": [ 6 | { 7 | "name": "Jeff Morrison", 8 | "email": "jeffmo@fb.com" 9 | } 10 | ], 11 | "main": "src/jstransform", 12 | "repository": { 13 | "type": "git", 14 | "url": "git@github.com:facebook/jstransform.git" 15 | }, 16 | "keywords": [ 17 | "transformer", 18 | "compiler", 19 | "syntax", 20 | "visitor" 21 | ], 22 | "dependencies": { 23 | "base62": "0.1.1", 24 | "esprima-fb": "12001.1.0-dev-harmony-fb", 25 | "source-map": "0.1.31" 26 | }, 27 | "licenses": [ 28 | { 29 | "type": "Apache-2.0", 30 | "url": "http://www.apache.org/licenses/LICENSE-2.0" 31 | } 32 | ], 33 | "engines": { 34 | "node": ">=0.8.8" 35 | }, 36 | "devDependencies": { 37 | "jest-cli": "^0.2", 38 | "jshint": "^2.5.10" 39 | }, 40 | "jest": { 41 | "scriptPreprocessor": "/jestPreprocessor.js", 42 | "setupEnvScriptFile": "/jestEnvironment.js", 43 | "testPathIgnorePatterns": [ 44 | "/node_modules/", 45 | "/__tests__/[^/]*/.+" 46 | ] 47 | }, 48 | "scripts": { 49 | "prepublish": "jest && jshint --config=.jshintrc --exclude=node_modules .", 50 | "test": "jest && jshint --config=.jshintrc --exclude=node_modules ." 51 | }, 52 | "gitHead": "0b85568e4ad5e27df7c2a0aebbd50f547c55194e", 53 | "bugs": { 54 | "url": "https://github.com/facebook/jstransform/issues" 55 | }, 56 | "homepage": "https://github.com/facebook/jstransform", 57 | "_id": "jstransform@9.1.1", 58 | "_shasum": "2085ae83ac4e28d5f247c56bf6e43404a85c4b14", 59 | "_from": "jstransform@", 60 | "_npmVersion": "1.4.21", 61 | "_npmUser": { 62 | "name": "jeffmo", 63 | "email": "lbljeffmo@gmail.com" 64 | }, 65 | "maintainers": [ 66 | { 67 | "name": "jeffmo", 68 | "email": "jeff@anafx.com" 69 | }, 70 | { 71 | "name": "zpao", 72 | "email": "paul@oshannessy.com" 73 | }, 74 | { 75 | "name": "amasad", 76 | "email": "amjad.masad@gmail.com" 77 | }, 78 | { 79 | "name": "gabelevi", 80 | "email": "gabelevi@gmail.com" 81 | } 82 | ], 83 | "dist": { 84 | "shasum": "2085ae83ac4e28d5f247c56bf6e43404a85c4b14", 85 | "tarball": "http://registry.npmjs.org/jstransform/-/jstransform-9.1.1.tgz" 86 | }, 87 | "directories": {}, 88 | "_resolved": "https://registry.npmjs.org/jstransform/-/jstransform-9.1.1.tgz", 89 | "readme": "ERROR: No README data found!" 90 | } 91 | -------------------------------------------------------------------------------- /Macros/Convert Bookmarklet to Javascript ᵇᵉᵗᵃ.tmMacro: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | commands 6 | 7 | 8 | command 9 | selectAll: 10 | 11 | 12 | argument 13 | 14 | beforeRunningCommand 15 | nop 16 | bundlePath 17 | /Library/Application Support/TextMate/Bundles/HTML.tmbundle 18 | command 19 | #!/usr/bin/env ruby -KA 20 | 21 | res = STDIN.read.gsub(/%([0-9A-Z]{2})/i) do |_| 22 | $1.to_i(16).chr 23 | end 24 | 25 | print res 26 | 27 | fallbackInput 28 | line 29 | input 30 | selection 31 | keyEquivalent 32 | @& 33 | name 34 | Decode URL Escapes in Selection — HTML 35 | output 36 | replaceSelectedText 37 | scope 38 | text.html 39 | supportPath 40 | /Library/Application Support/TextMate/Bundles/HTML.tmbundle/Support 41 | uuid 42 | 2C4C9673-B166-432A-8938-75A5CA622481 43 | 44 | command 45 | executeCommandWithOptions: 46 | 47 | 48 | argument 49 | 50 | action 51 | replaceAll 52 | findInProjectIgnoreCase 53 | 54 | findString 55 | ({|}) 56 | ignoreCase 57 | 58 | regularExpression 59 | 60 | replaceAllScope 61 | document 62 | replaceString 63 | \n$1\n 64 | wrapAround 65 | 66 | 67 | command 68 | findWithOptions: 69 | 70 | 71 | command 72 | selectAll: 73 | 74 | 75 | command 76 | indent: 77 | 78 | 79 | keyEquivalent 80 | ^~Q 81 | name 82 | Convert Bookmarklet to Javascript ᵇᵉᵗᵃ 83 | scope 84 | source.js 85 | scopeType 86 | local 87 | uuid 88 | B4DDB005-470D-4D22-8FE8-B29FDC613A7A 89 | 90 | 91 | -------------------------------------------------------------------------------- /Macros/Convert Javascript to Bookmarklet ᵇᵉᵗᵃ.tmMacro: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | commands 6 | 7 | 8 | argument 9 | 10 | beforeRunningCommand 11 | nop 12 | command 13 | ruby "$TM_BUNDLE_SUPPORT/bin/jsmin.rb" 14 | 15 | input 16 | selection 17 | keyEquivalent 18 | ^~Q 19 | name 20 | Minimize selection 21 | output 22 | replaceSelectedText 23 | scope 24 | source.js, source.prototype.js 25 | uuid 26 | E620A7EF-DB9B-48D9-874F-60EAF426E70D 27 | 28 | command 29 | executeCommandWithOptions: 30 | 31 | 32 | argument 33 | 34 | action 35 | replaceAll 36 | findInProjectIgnoreCase 37 | 38 | findInProjectRegularExpression 39 | 40 | findString 41 | \n| 42 | ignoreCase 43 | 44 | regularExpression 45 | 46 | replaceAllScope 47 | selection 48 | replaceString 49 | %20 50 | wrapAround 51 | 52 | 53 | command 54 | findWithOptions: 55 | 56 | 57 | argument 58 | 59 | action 60 | replaceAll 61 | findInProjectIgnoreCase 62 | 63 | findInProjectRegularExpression 64 | 65 | findString 66 | ^ 67 | ignoreCase 68 | 69 | regularExpression 70 | 71 | replaceAllScope 72 | selection 73 | replaceString 74 | javascript: 75 | wrapAround 76 | 77 | 78 | command 79 | findWithOptions: 80 | 81 | 82 | keyEquivalent 83 | ^~Q 84 | name 85 | Convert Javascript to Bookmarklet ᵇᵉᵗᵃ 86 | scope 87 | source.js 88 | uuid 89 | 67347C19-DA7A-41B8-8C48-8CC92E11E4E3 90 | 91 | 92 | -------------------------------------------------------------------------------- /Support/node_modules/jstransform/visitors/es7-rest-property-helpers.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2013 Facebook, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /*jslint node:true*/ 18 | 19 | /** 20 | * Desugars ES7 rest properties into ES5 object iteration. 21 | */ 22 | 23 | var Syntax = require('esprima-fb').Syntax; 24 | 25 | // TODO: This is a pretty massive helper, it should only be defined once, in the 26 | // transform's runtime environment. We don't currently have a runtime though. 27 | var restFunction = 28 | '(function(source, exclusion) {' + 29 | 'var rest = {};' + 30 | 'var hasOwn = Object.prototype.hasOwnProperty;' + 31 | 'if (source == null) {' + 32 | 'throw new TypeError();' + 33 | '}' + 34 | 'for (var key in source) {' + 35 | 'if (hasOwn.call(source, key) && !hasOwn.call(exclusion, key)) {' + 36 | 'rest[key] = source[key];' + 37 | '}' + 38 | '}' + 39 | 'return rest;' + 40 | '})'; 41 | 42 | function getPropertyNames(properties) { 43 | var names = []; 44 | for (var i = 0; i < properties.length; i++) { 45 | var property = properties[i]; 46 | if (property.type === Syntax.SpreadProperty) { 47 | continue; 48 | } 49 | if (property.type === Syntax.Identifier) { 50 | names.push(property.name); 51 | } else { 52 | names.push(property.key.name); 53 | } 54 | } 55 | return names; 56 | } 57 | 58 | function getRestFunctionCall(source, exclusion) { 59 | return restFunction + '(' + source + ',' + exclusion + ')'; 60 | } 61 | 62 | function getSimpleShallowCopy(accessorExpression) { 63 | // This could be faster with 'Object.assign({}, ' + accessorExpression + ')' 64 | // but to unify code paths and avoid a ES6 dependency we use the same 65 | // helper as for the exclusion case. 66 | return getRestFunctionCall(accessorExpression, '{}'); 67 | } 68 | 69 | function renderRestExpression(accessorExpression, excludedProperties) { 70 | var excludedNames = getPropertyNames(excludedProperties); 71 | if (!excludedNames.length) { 72 | return getSimpleShallowCopy(accessorExpression); 73 | } 74 | return getRestFunctionCall( 75 | accessorExpression, 76 | '{' + excludedNames.join(':1,') + ':1}' 77 | ); 78 | } 79 | 80 | exports.renderRestExpression = renderRestExpression; 81 | -------------------------------------------------------------------------------- /Support/bin/jshint.textmate.js: -------------------------------------------------------------------------------- 1 | /*jshint asi:true*/ 2 | 3 | var QUICK = process.argv.indexOf('quick') >= 0 4 | 5 | var JSHINT = require('./jshint').JSHINT 6 | var BS = require('./bs').BS 7 | var TextMate = require('./TextMate') 8 | 9 | var FILEPATH = QUICK? process.env.TM_FILEPATH : process.env.TMPDIR + "validate.me.js" 10 | 11 | process.stdin.resume() 12 | process.stdin.setEncoding('utf8') 13 | 14 | var CODE = '' 15 | 16 | process.stdin.on('data', function(chunk){ 17 | CODE += chunk 18 | }) 19 | 20 | process.stdin.on('end', function(){ 21 | if (JSHINT(''+CODE)) QUICK? quickPASS() : PASS() 22 | else QUICK? quickFAIL() : FAIL() 23 | }) 24 | 25 | function quickPASS(){ 26 | console.log(JSHINT.errors.length + ' Issues - JSHint') 27 | } 28 | 29 | function quickFAIL(){ 30 | console.log(JSHINT.errors.length + ' Issues — JSHint') 31 | } 32 | 33 | function PASS(){ 34 | 35 | } 36 | 37 | function FAIL(){ 38 | // console.log(JSHINT.errors) 39 | console.log(''+BS('style',"\ 40 | \ 41 | table{\ 42 | width: 100%;\ 43 | }\ 44 | \ 45 | \ 46 | tr:nth-child(even){\ 47 | background-color: #f9f9f9;\ 48 | }\ 49 | \ 50 | td,th{\ 51 | font-weight: normal;\ 52 | padding: .5ex 1ex;\ 53 | text-align: left;\ 54 | vertical-align: top;\ 55 | overflow: hidden;\ 56 | text-overflow: ellipsis;\ 57 | }\ 58 | \ 59 | th{\ 60 | min-width: 25ex;\ 61 | text-align: right;\ 62 | }\ 63 | \ 64 | td code{\ 65 | white-space: pre;\ 66 | }\ 67 | \ 68 | ")) 69 | console.log('') 70 | JSHINT.errors.forEach(reportError) 71 | console.log('
') 72 | } 73 | 74 | function reportError(message){ 75 | console.log 76 | ((''+BS('') 77 | ('tr',BS('') 78 | ('th',BS('') 79 | ('A' 80 | // +' style="display:block;background:#eee;margin:1ex;"' 81 | +' href="' + TextMate.href(process.env.TM_FILEPATH, message.line, message.character) + '"' 82 | ,BS('') 83 | ('', message.reason) 84 | ) 85 | ) 86 | ('td',BS('code', String(message.evidence).replace(/&/g,'&').replace(/= 0 && aIdx < this._array.length) { 81 | return this._array[aIdx]; 82 | } 83 | throw new Error('No element indexed by ' + aIdx); 84 | }; 85 | 86 | /** 87 | * Returns the array representation of this set (which has the proper indices 88 | * indicated by indexOf). Note that this is a copy of the internal array used 89 | * for storing the members so that no one can mess with internal state. 90 | */ 91 | ArraySet.prototype.toArray = function ArraySet_toArray() { 92 | return this._array.slice(); 93 | }; 94 | 95 | exports.ArraySet = ArraySet; 96 | 97 | }); 98 | -------------------------------------------------------------------------------- /Support/node_modules/jstransform/visitors/es7-spread-property-visitors.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2004-present Facebook. All Rights Reserved. 3 | */ 4 | /*global exports:true*/ 5 | 6 | /** 7 | * Implements ES7 object spread property. 8 | * https://gist.github.com/sebmarkbage/aa849c7973cb4452c547 9 | * 10 | * { ...a, x: 1 } 11 | * 12 | * Object.assign({}, a, {x: 1 }) 13 | * 14 | */ 15 | 16 | var Syntax = require('esprima-fb').Syntax; 17 | var utils = require('../src/utils'); 18 | 19 | function visitObjectLiteralSpread(traverse, node, path, state) { 20 | utils.catchup(node.range[0], state); 21 | 22 | utils.append('Object.assign({', state); 23 | 24 | // Skip the original { 25 | utils.move(node.range[0] + 1, state); 26 | 27 | var previousWasSpread = false; 28 | 29 | for (var i = 0; i < node.properties.length; i++) { 30 | var property = node.properties[i]; 31 | if (property.type === Syntax.SpreadProperty) { 32 | 33 | // Close the previous object or initial object 34 | if (!previousWasSpread) { 35 | utils.append('}', state); 36 | } 37 | 38 | if (i === 0) { 39 | // Normally there will be a comma when we catch up, but not before 40 | // the first property. 41 | utils.append(',', state); 42 | } 43 | 44 | utils.catchup(property.range[0], state); 45 | 46 | // skip ... 47 | utils.move(property.range[0] + 3, state); 48 | 49 | traverse(property.argument, path, state); 50 | 51 | utils.catchup(property.range[1], state); 52 | 53 | previousWasSpread = true; 54 | 55 | } else { 56 | 57 | utils.catchup(property.range[0], state); 58 | 59 | if (previousWasSpread) { 60 | utils.append('{', state); 61 | } 62 | 63 | traverse(property, path, state); 64 | 65 | utils.catchup(property.range[1], state); 66 | 67 | previousWasSpread = false; 68 | 69 | } 70 | } 71 | 72 | // Strip any non-whitespace between the last item and the end. 73 | // We only catch up on whitespace so that we ignore any trailing commas which 74 | // are stripped out for IE8 support. Unfortunately, this also strips out any 75 | // trailing comments. 76 | utils.catchupWhiteSpace(node.range[1] - 1, state); 77 | 78 | // Skip the trailing } 79 | utils.move(node.range[1], state); 80 | 81 | if (!previousWasSpread) { 82 | utils.append('}', state); 83 | } 84 | 85 | utils.append(')', state); 86 | return false; 87 | } 88 | 89 | visitObjectLiteralSpread.test = function(node, path, state) { 90 | if (node.type !== Syntax.ObjectExpression) { 91 | return false; 92 | } 93 | // Tight loop optimization 94 | var hasAtLeastOneSpreadProperty = false; 95 | for (var i = 0; i < node.properties.length; i++) { 96 | var property = node.properties[i]; 97 | if (property.type === Syntax.SpreadProperty) { 98 | hasAtLeastOneSpreadProperty = true; 99 | } else if (property.kind !== 'init') { 100 | return false; 101 | } 102 | } 103 | return hasAtLeastOneSpreadProperty; 104 | }; 105 | 106 | exports.visitorList = [ 107 | visitObjectLiteralSpread 108 | ]; 109 | -------------------------------------------------------------------------------- /Support/node_modules/jstransform/node_modules/esprima-fb/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "esprima-fb", 3 | "description": "Facebook-specific fork of the esprima project", 4 | "homepage": "https://github.com/facebook/esprima/tree/fb-harmony", 5 | "main": "esprima.js", 6 | "bin": { 7 | "esparse": "./bin/esparse.js", 8 | "esvalidate": "./bin/esvalidate.js" 9 | }, 10 | "version": "12001.1.0-dev-harmony-fb", 11 | "files": [ 12 | "bin", 13 | "test/run.js", 14 | "test/runner.js", 15 | "test/test.js", 16 | "test/compat.js", 17 | "test/reflect.js", 18 | "esprima.js" 19 | ], 20 | "engines": { 21 | "node": ">=0.4.0" 22 | }, 23 | "author": { 24 | "name": "Ariya Hidayat", 25 | "email": "ariya.hidayat@gmail.com" 26 | }, 27 | "maintainers": [ 28 | { 29 | "name": "jeffmo", 30 | "email": "jeff@anafx.com" 31 | }, 32 | { 33 | "name": "zpao", 34 | "email": "paul@oshannessy.com" 35 | }, 36 | { 37 | "name": "gabelevi", 38 | "email": "gabelevi@gmail.com" 39 | } 40 | ], 41 | "repository": { 42 | "type": "git", 43 | "url": "http://github.com/facebook/esprima.git" 44 | }, 45 | "bugs": { 46 | "url": "http://issues.esprima.org" 47 | }, 48 | "licenses": [ 49 | { 50 | "type": "BSD", 51 | "url": "http://github.com/facebook/esprima/raw/master/LICENSE.BSD" 52 | } 53 | ], 54 | "devDependencies": { 55 | "jslint": "~0.1.9", 56 | "eslint": "~0.1.0", 57 | "istanbul": "~0.2.6", 58 | "complexity-report": "~0.6.1", 59 | "regenerate": "~0.5.4", 60 | "unicode-6.3.0": "~0.1.0", 61 | "json-diff": "~0.3.1", 62 | "commander": "~2.5.0" 63 | }, 64 | "scripts": { 65 | "test": "npm run-script lint && node test/run.js && npm run-script coverage && npm run-script complexity", 66 | "lint": "node tools/check-version.js && node node_modules/eslint/bin/eslint.js esprima.js && node node_modules/jslint/bin/jslint.js esprima.js", 67 | "coverage": "npm run-script analyze-coverage && npm run-script check-coverage", 68 | "analyze-coverage": "node node_modules/istanbul/lib/cli.js cover test/runner.js", 69 | "check-coverage": "node node_modules/istanbul/lib/cli.js check-coverage --statement 100 --branch 100 --function 100", 70 | "complexity": "npm run-script analyze-complexity && npm run-script check-complexity", 71 | "analyze-complexity": "node tools/list-complexity.js", 72 | "check-complexity": "node node_modules/complexity-report/src/cli.js --maxcc 31 --silent -l -w esprima.js", 73 | "benchmark": "node test/benchmarks.js", 74 | "benchmark-quick": "node test/benchmarks.js quick" 75 | }, 76 | "gitHead": "b339b4c7e3e5a962991ec6b14bd34899e5e70608", 77 | "_id": "esprima-fb@12001.1.0-dev-harmony-fb", 78 | "_shasum": "d84400384ba95ce2678c617ad24a7f40808da915", 79 | "_from": "esprima-fb@12001.1.0-dev-harmony-fb", 80 | "_npmVersion": "1.4.16", 81 | "_npmUser": { 82 | "name": "gabelevi", 83 | "email": "gabelevi@gmail.com" 84 | }, 85 | "dist": { 86 | "shasum": "d84400384ba95ce2678c617ad24a7f40808da915", 87 | "tarball": "http://registry.npmjs.org/esprima-fb/-/esprima-fb-12001.1.0-dev-harmony-fb.tgz" 88 | }, 89 | "directories": {}, 90 | "_resolved": "https://registry.npmjs.org/esprima-fb/-/esprima-fb-12001.1.0-dev-harmony-fb.tgz", 91 | "readme": "ERROR: No README data found!" 92 | } 93 | -------------------------------------------------------------------------------- /Support/bin/js-beautify/javascriptobfuscator_unpacker.js: -------------------------------------------------------------------------------- 1 | // 2 | // simple unpacker/deobfuscator for scripts messed up with javascriptobfuscator.com 3 | // written by Einar Lielmanis 4 | // 5 | // usage: 6 | // 7 | // if (JavascriptObfuscator.detect(some_string)) { 8 | // var unpacked = JavascriptObfuscator.unpack(some_string); 9 | // } 10 | // 11 | // 12 | 13 | var JavascriptObfuscator = { 14 | detect: function (str) { 15 | return /^var _0x[a-f0-9]+ ?\= ?\[/.test(str); 16 | }, 17 | 18 | unpack: function (str) { 19 | if (JavascriptObfuscator.detect(str)) { 20 | var matches = /var (_0x[a-f\d]+) ?\= ?\[(.*?)\];/.exec(str); 21 | if (matches) { 22 | var var_name = matches[1]; 23 | var strings = JavascriptObfuscator._smart_split(JavascriptObfuscator._unescape(matches[2])); 24 | var str = str.substring(matches[0].length); 25 | for (var k in strings) { 26 | str = str.replace(new RegExp(var_name + '\\[' + k + '\\]', 'g'), strings[k]); 27 | } 28 | } 29 | } 30 | return str; 31 | }, 32 | 33 | _smart_split: function(str) { 34 | var strings = []; 35 | var pos = 0; 36 | while (pos < str.length) { 37 | if (str.charAt(pos) == '"') { 38 | // new word 39 | var word = ''; 40 | pos += 1; 41 | while (pos < str.length) { 42 | if (str.charAt(pos) == '"') { 43 | break; 44 | } 45 | if (str.charAt(pos) == '\\') { 46 | word += '\\'; 47 | pos++; 48 | } 49 | word += str.charAt(pos); 50 | pos++; 51 | } 52 | strings.push('"' + word + '"'); 53 | } 54 | pos += 1; 55 | } 56 | return strings; 57 | }, 58 | 59 | 60 | _unescape: function (str) { 61 | // inefficient if used repeatedly or on small strings, but wonderful on single large chunk of text 62 | for (var i = 32; i < 128; i++) { 63 | str = str.replace(new RegExp('\\\\x' + i.toString(16), 'ig'), String.fromCharCode(i)); 64 | } 65 | return str; 66 | }, 67 | 68 | 69 | run_tests: function (sanity_test) { 70 | var t = sanity_test || new SanityTest(); 71 | t.test_function(JavascriptObfuscator._smart_split, "JavascriptObfuscator._smart_split"); 72 | t.expect('', []); 73 | t.expect('"a", "b"', ['"a"', '"b"']); 74 | t.expect('"aaa","bbbb"', ['"aaa"', '"bbbb"']); 75 | t.expect('"a", "b\\\""', ['"a"', '"b\\\""']); 76 | t.test_function(JavascriptObfuscator._unescape, 'JavascriptObfuscator._unescape'); 77 | t.expect('\\x40', '@'); 78 | t.expect('\\x10', '\\x10'); 79 | t.expect('\\x1', '\\x1'); 80 | t.test_function(JavascriptObfuscator.detect, 'JavascriptObfuscator.detect'); 81 | t.expect('', false); 82 | t.expect('abcd', false); 83 | t.expect('var _0xaaaa', false); 84 | t.expect('var _0xaaaa = ["a", "b"]', true); 85 | t.expect('var _0xaaaa=["a", "b"]', true); 86 | t.expect('var _0x1234=["a","b"]', true); 87 | return t; 88 | } 89 | 90 | 91 | } 92 | -------------------------------------------------------------------------------- /Support/node_modules/jstransform/node_modules/source-map/lib/source-map/binary-search.js: -------------------------------------------------------------------------------- 1 | /* -*- Mode: js; js-indent-level: 2; -*- */ 2 | /* 3 | * Copyright 2011 Mozilla Foundation and contributors 4 | * Licensed under the New BSD license. See LICENSE or: 5 | * http://opensource.org/licenses/BSD-3-Clause 6 | */ 7 | if (typeof define !== 'function') { 8 | var define = require('amdefine')(module, require); 9 | } 10 | define(function (require, exports, module) { 11 | 12 | /** 13 | * Recursive implementation of binary search. 14 | * 15 | * @param aLow Indices here and lower do not contain the needle. 16 | * @param aHigh Indices here and higher do not contain the needle. 17 | * @param aNeedle The element being searched for. 18 | * @param aHaystack The non-empty array being searched. 19 | * @param aCompare Function which takes two elements and returns -1, 0, or 1. 20 | */ 21 | function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare) { 22 | // This function terminates when one of the following is true: 23 | // 24 | // 1. We find the exact element we are looking for. 25 | // 26 | // 2. We did not find the exact element, but we can return the next 27 | // closest element that is less than that element. 28 | // 29 | // 3. We did not find the exact element, and there is no next-closest 30 | // element which is less than the one we are searching for, so we 31 | // return null. 32 | var mid = Math.floor((aHigh - aLow) / 2) + aLow; 33 | var cmp = aCompare(aNeedle, aHaystack[mid], true); 34 | if (cmp === 0) { 35 | // Found the element we are looking for. 36 | return aHaystack[mid]; 37 | } 38 | else if (cmp > 0) { 39 | // aHaystack[mid] is greater than our needle. 40 | if (aHigh - mid > 1) { 41 | // The element is in the upper half. 42 | return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare); 43 | } 44 | // We did not find an exact match, return the next closest one 45 | // (termination case 2). 46 | return aHaystack[mid]; 47 | } 48 | else { 49 | // aHaystack[mid] is less than our needle. 50 | if (mid - aLow > 1) { 51 | // The element is in the lower half. 52 | return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare); 53 | } 54 | // The exact needle element was not found in this haystack. Determine if 55 | // we are in termination case (2) or (3) and return the appropriate thing. 56 | return aLow < 0 57 | ? null 58 | : aHaystack[aLow]; 59 | } 60 | } 61 | 62 | /** 63 | * This is an implementation of binary search which will always try and return 64 | * the next lowest value checked if there is no exact hit. This is because 65 | * mappings between original and generated line/col pairs are single points, 66 | * and there is an implicit region between each of them, so a miss just means 67 | * that you aren't on the very start of a region. 68 | * 69 | * @param aNeedle The element you are looking for. 70 | * @param aHaystack The array that is being searched. 71 | * @param aCompare A function which takes the needle and an element in the 72 | * array and returns -1, 0, or 1 depending on whether the needle is less 73 | * than, equal to, or greater than the element, respectively. 74 | */ 75 | exports.search = function search(aNeedle, aHaystack, aCompare) { 76 | return aHaystack.length > 0 77 | ? recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack, aCompare) 78 | : null; 79 | }; 80 | 81 | }); 82 | -------------------------------------------------------------------------------- /Support/node_modules/jstransform/visitors/es6-rest-param-visitors.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2013 Facebook, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /*jslint node:true*/ 18 | 19 | /** 20 | * Desugars ES6 rest parameters into an ES3 arguments array. 21 | * 22 | * function printf(template, ...args) { 23 | * args.forEach(...); 24 | * } 25 | * 26 | * We could use `Array.prototype.slice.call`, but that usage of arguments causes 27 | * functions to be deoptimized in V8, so instead we use a for-loop. 28 | * 29 | * function printf(template) { 30 | * for (var args = [], $__0 = 1, $__1 = arguments.length; $__0 < $__1; $__0++) 31 | * args.push(arguments[$__0]); 32 | * args.forEach(...); 33 | * } 34 | * 35 | */ 36 | var Syntax = require('esprima-fb').Syntax; 37 | var utils = require('../src/utils'); 38 | 39 | 40 | 41 | function _nodeIsFunctionWithRestParam(node) { 42 | return (node.type === Syntax.FunctionDeclaration 43 | || node.type === Syntax.FunctionExpression 44 | || node.type === Syntax.ArrowFunctionExpression) 45 | && node.rest; 46 | } 47 | 48 | function visitFunctionParamsWithRestParam(traverse, node, path, state) { 49 | if (node.parametricType) { 50 | utils.catchup(node.parametricType.range[0], state); 51 | path.unshift(node); 52 | traverse(node.parametricType, path, state); 53 | path.shift(); 54 | } 55 | 56 | // Render params. 57 | if (node.params.length) { 58 | path.unshift(node); 59 | traverse(node.params, path, state); 60 | path.shift(); 61 | } else { 62 | // -3 is for ... of the rest. 63 | utils.catchup(node.rest.range[0] - 3, state); 64 | } 65 | utils.catchupWhiteSpace(node.rest.range[1], state); 66 | 67 | path.unshift(node); 68 | traverse(node.body, path, state); 69 | path.shift(); 70 | 71 | return false; 72 | } 73 | 74 | visitFunctionParamsWithRestParam.test = function(node, path, state) { 75 | return _nodeIsFunctionWithRestParam(node); 76 | }; 77 | 78 | function renderRestParamSetup(functionNode, state) { 79 | var idx = state.localScope.tempVarIndex++; 80 | var len = state.localScope.tempVarIndex++; 81 | 82 | return 'for (var ' + functionNode.rest.name + '=[],' + 83 | utils.getTempVar(idx) + '=' + functionNode.params.length + ',' + 84 | utils.getTempVar(len) + '=arguments.length;' + 85 | utils.getTempVar(idx) + '<' + utils.getTempVar(len) + ';' + 86 | utils.getTempVar(idx) + '++) ' + 87 | functionNode.rest.name + '.push(arguments[' + utils.getTempVar(idx) + ']);'; 88 | } 89 | 90 | function visitFunctionBodyWithRestParam(traverse, node, path, state) { 91 | utils.catchup(node.range[0] + 1, state); 92 | var parentNode = path[0]; 93 | utils.append(renderRestParamSetup(parentNode, state), state); 94 | return true; 95 | } 96 | 97 | visitFunctionBodyWithRestParam.test = function(node, path, state) { 98 | return node.type === Syntax.BlockStatement 99 | && _nodeIsFunctionWithRestParam(path[0]); 100 | }; 101 | 102 | exports.renderRestParamSetup = renderRestParamSetup; 103 | exports.visitorList = [ 104 | visitFunctionParamsWithRestParam, 105 | visitFunctionBodyWithRestParam 106 | ]; 107 | -------------------------------------------------------------------------------- /Support/node_modules/jstransform/node_modules/source-map/test/source-map/test-array-set.js: -------------------------------------------------------------------------------- 1 | /* -*- Mode: js; js-indent-level: 2; -*- */ 2 | /* 3 | * Copyright 2011 Mozilla Foundation and contributors 4 | * Licensed under the New BSD license. See LICENSE or: 5 | * http://opensource.org/licenses/BSD-3-Clause 6 | */ 7 | if (typeof define !== 'function') { 8 | var define = require('amdefine')(module, require); 9 | } 10 | define(function (require, exports, module) { 11 | 12 | var ArraySet = require('../../lib/source-map/array-set').ArraySet; 13 | 14 | function makeTestSet() { 15 | var set = new ArraySet(); 16 | for (var i = 0; i < 100; i++) { 17 | set.add(String(i)); 18 | } 19 | return set; 20 | } 21 | 22 | exports['test .has() membership'] = function (assert, util) { 23 | var set = makeTestSet(); 24 | for (var i = 0; i < 100; i++) { 25 | assert.ok(set.has(String(i))); 26 | } 27 | }; 28 | 29 | exports['test .indexOf() elements'] = function (assert, util) { 30 | var set = makeTestSet(); 31 | for (var i = 0; i < 100; i++) { 32 | assert.strictEqual(set.indexOf(String(i)), i); 33 | } 34 | }; 35 | 36 | exports['test .at() indexing'] = function (assert, util) { 37 | var set = makeTestSet(); 38 | for (var i = 0; i < 100; i++) { 39 | assert.strictEqual(set.at(i), String(i)); 40 | } 41 | }; 42 | 43 | exports['test creating from an array'] = function (assert, util) { 44 | var set = ArraySet.fromArray(['foo', 'bar', 'baz', 'quux', 'hasOwnProperty']); 45 | 46 | assert.ok(set.has('foo')); 47 | assert.ok(set.has('bar')); 48 | assert.ok(set.has('baz')); 49 | assert.ok(set.has('quux')); 50 | assert.ok(set.has('hasOwnProperty')); 51 | 52 | assert.strictEqual(set.indexOf('foo'), 0); 53 | assert.strictEqual(set.indexOf('bar'), 1); 54 | assert.strictEqual(set.indexOf('baz'), 2); 55 | assert.strictEqual(set.indexOf('quux'), 3); 56 | 57 | assert.strictEqual(set.at(0), 'foo'); 58 | assert.strictEqual(set.at(1), 'bar'); 59 | assert.strictEqual(set.at(2), 'baz'); 60 | assert.strictEqual(set.at(3), 'quux'); 61 | }; 62 | 63 | exports['test that you can add __proto__; see github issue #30'] = function (assert, util) { 64 | var set = new ArraySet(); 65 | set.add('__proto__'); 66 | assert.ok(set.has('__proto__')); 67 | assert.strictEqual(set.at(0), '__proto__'); 68 | assert.strictEqual(set.indexOf('__proto__'), 0); 69 | }; 70 | 71 | exports['test .fromArray() with duplicates'] = function (assert, util) { 72 | var set = ArraySet.fromArray(['foo', 'foo']); 73 | assert.ok(set.has('foo')); 74 | assert.strictEqual(set.at(0), 'foo'); 75 | assert.strictEqual(set.indexOf('foo'), 0); 76 | assert.strictEqual(set.toArray().length, 1); 77 | 78 | set = ArraySet.fromArray(['foo', 'foo'], true); 79 | assert.ok(set.has('foo')); 80 | assert.strictEqual(set.at(0), 'foo'); 81 | assert.strictEqual(set.at(1), 'foo'); 82 | assert.strictEqual(set.indexOf('foo'), 0); 83 | assert.strictEqual(set.toArray().length, 2); 84 | }; 85 | 86 | exports['test .add() with duplicates'] = function (assert, util) { 87 | var set = new ArraySet(); 88 | set.add('foo'); 89 | 90 | set.add('foo'); 91 | assert.ok(set.has('foo')); 92 | assert.strictEqual(set.at(0), 'foo'); 93 | assert.strictEqual(set.indexOf('foo'), 0); 94 | assert.strictEqual(set.toArray().length, 1); 95 | 96 | set.add('foo', true); 97 | assert.ok(set.has('foo')); 98 | assert.strictEqual(set.at(0), 'foo'); 99 | assert.strictEqual(set.at(1), 'foo'); 100 | assert.strictEqual(set.indexOf('foo'), 0); 101 | assert.strictEqual(set.toArray().length, 2); 102 | }; 103 | 104 | }); 105 | -------------------------------------------------------------------------------- /Support/node_modules/jstransform/visitors/es6-call-spread-visitors.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2004-present Facebook. All Rights Reserved. 3 | */ 4 | /*global exports:true*/ 5 | 6 | /** 7 | * Implements ES6 call spread. 8 | * 9 | * instance.method(a, b, c, ...d) 10 | * 11 | * instance.method.apply(instance, [a, b, c].concat(d)) 12 | * 13 | */ 14 | 15 | var Syntax = require('esprima-fb').Syntax; 16 | var utils = require('../src/utils'); 17 | 18 | function process(traverse, node, path, state) { 19 | utils.move(node.range[0], state); 20 | traverse(node, path, state); 21 | utils.catchup(node.range[1], state); 22 | } 23 | 24 | function visitCallSpread(traverse, node, path, state) { 25 | utils.catchup(node.range[0], state); 26 | 27 | if (node.type === Syntax.NewExpression) { 28 | // Input = new Set(1, 2, ...list) 29 | // Output = new (Function.prototype.bind.apply(Set, [null, 1, 2].concat(list))) 30 | utils.append('new (Function.prototype.bind.apply(', state); 31 | process(traverse, node.callee, path, state); 32 | } else if (node.callee.type === Syntax.MemberExpression) { 33 | // Input = get().fn(1, 2, ...more) 34 | // Output = (_ = get()).fn.apply(_, [1, 2].apply(more)) 35 | var tempVar = utils.injectTempVar(state); 36 | utils.append('(' + tempVar + ' = ', state); 37 | process(traverse, node.callee.object, path, state); 38 | utils.append(')', state); 39 | if (node.callee.property.type === Syntax.Identifier) { 40 | utils.append('.', state); 41 | process(traverse, node.callee.property, path, state); 42 | } else { 43 | utils.append('[', state); 44 | process(traverse, node.callee.property, path, state); 45 | utils.append(']', state); 46 | } 47 | utils.append('.apply(' + tempVar, state); 48 | } else { 49 | // Input = max(1, 2, ...list) 50 | // Output = max.apply(null, [1, 2].concat(list)) 51 | var needsToBeWrappedInParenthesis = 52 | node.callee.type === Syntax.FunctionDeclaration || 53 | node.callee.type === Syntax.FunctionExpression; 54 | if (needsToBeWrappedInParenthesis) { 55 | utils.append('(', state); 56 | } 57 | process(traverse, node.callee, path, state); 58 | if (needsToBeWrappedInParenthesis) { 59 | utils.append(')', state); 60 | } 61 | utils.append('.apply(null', state); 62 | } 63 | utils.append(', ', state); 64 | 65 | var args = node.arguments.slice(); 66 | var spread = args.pop(); 67 | if (args.length || node.type === Syntax.NewExpression) { 68 | utils.append('[', state); 69 | if (node.type === Syntax.NewExpression) { 70 | utils.append('null' + (args.length ? ', ' : ''), state); 71 | } 72 | while (args.length) { 73 | var arg = args.shift(); 74 | utils.move(arg.range[0], state); 75 | traverse(arg, path, state); 76 | if (args.length) { 77 | utils.catchup(args[0].range[0], state); 78 | } else { 79 | utils.catchup(arg.range[1], state); 80 | } 81 | } 82 | utils.append('].concat(', state); 83 | process(traverse, spread.argument, path, state); 84 | utils.append(')', state); 85 | } else { 86 | process(traverse, spread.argument, path, state); 87 | } 88 | utils.append(node.type === Syntax.NewExpression ? '))' : ')', state); 89 | 90 | utils.move(node.range[1], state); 91 | return false; 92 | } 93 | 94 | visitCallSpread.test = function(node, path, state) { 95 | return ( 96 | ( 97 | node.type === Syntax.CallExpression || 98 | node.type === Syntax.NewExpression 99 | ) && 100 | node.arguments.length > 0 && 101 | node.arguments[node.arguments.length - 1].type === Syntax.SpreadElement 102 | ); 103 | }; 104 | 105 | exports.visitorList = [ 106 | visitCallSpread, 107 | ]; 108 | -------------------------------------------------------------------------------- /Support/bin/js-beautify/beautify-cl.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | JS Beautifier Rhino command line script 4 | ---------------------------------------- 5 | 6 | Written by Patrick Hof, 7 | 8 | This script is to be run with Rhino[1], the JavaScript Engine written in Java, 9 | on the command line. 10 | 11 | Usage: 12 | java org.mozilla.javascript.tools.shell.Main beautify-cl.js 13 | 14 | You are free to use this in any way you want, in case you find this useful or working for you. 15 | 16 | [1] http://www.mozilla.org/rhino/ 17 | 18 | */ 19 | load("beautify.js"); 20 | load("HTML-Beautify.js"); 21 | 22 | 23 | function print_usage() { 24 | print("Usage: java org.mozilla.javascript.tools.shell.Main beautify-cl.js [options] [file || URL]\n"); 25 | print("Reads from standard input if no file or URL is specified.\n"); 26 | print("Options:"); 27 | print("-i NUM\tIndent size (1 for TAB)"); 28 | print("-n\tPreserve newlines"); 29 | print("-p\tJSLint-pedantic mode, currently only adds space between \"function ()\""); 30 | print("-h\tPrint this help\n"); 31 | print("Examples:"); 32 | print("beautify-cl.js -i 2 example.js"); 33 | print("beautify-cl.js -i 1 http://www.example.org/example.js\n"); 34 | } 35 | 36 | 37 | function parse_opts(args) { 38 | var options = []; 39 | while (args.length > 0) { 40 | param = args.shift(); 41 | if (param.substr(0, 1) == '-') { 42 | switch (param) { 43 | case "-i": 44 | options.indent = args.shift(); 45 | break; 46 | case "-p": 47 | options.jslint_pedantic = true; 48 | break; 49 | case "-n": 50 | options.preserve_newlines = true; 51 | break; 52 | case "-h": 53 | print_usage(); 54 | quit(); 55 | break; 56 | default: 57 | print("Unknown parameter: " + param + "\n"); 58 | print("Aborting."); 59 | quit(); 60 | } 61 | } else { 62 | options.source = param; 63 | } 64 | } 65 | return options; 66 | } 67 | 68 | 69 | function do_js_beautify() { 70 | var js_source = ''; 71 | if (options.source) { // Check if source argument is an URL 72 | if (options.source.substring(0, 4) === 'http') { 73 | js_source = readUrl(options.source); 74 | } else { // Otherwise, read from file 75 | js_source = readFile(options.source); 76 | } 77 | } else { // read from stdin 78 | importPackage(java.io); 79 | importPackage(java.lang); 80 | var stdin = new BufferedReader(new InputStreamReader(System['in'])); 81 | var lines = []; 82 | 83 | // read stdin buffer until EOF 84 | while (stdin.ready()) { 85 | lines.push(stdin.readLine()); 86 | } 87 | if (lines.length) js_source = lines.join("\n"); 88 | } 89 | js_source = js_source.replace(/^\s+/, ''); 90 | var indent_size = options.indent || 2; 91 | var preserve_newlines = options.preserve_newlines || false; 92 | var indent_char = ' '; 93 | var result; 94 | if (indent_size == 1) { 95 | indent_char = '\t'; 96 | } 97 | if (js_source && js_source[0] === '<') { 98 | result = style_html(js_source, indent_size, indent_char, 80); 99 | } else { 100 | result = js_beautify(js_source, { 101 | indent_size: indent_size, 102 | indent_char: indent_char, 103 | preserve_newlines: preserve_newlines, 104 | space_after_anon_function: options.jslint_pedantic 105 | }); 106 | } 107 | return result; 108 | } 109 | 110 | 111 | options = parse_opts(arguments); 112 | print(do_js_beautify()); 113 | -------------------------------------------------------------------------------- /Support/JSHint Prefs App/prefs.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | JSHint Prefs 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /Support/bin/packr-1.0.2/lib/packr/regexp_group.rb: -------------------------------------------------------------------------------- 1 | class Packr 2 | class RegexpGroup 3 | 4 | attr_accessor :values 5 | 6 | IGNORE = "\\0" 7 | BACK_REF = /\\(\d+)/ 8 | ESCAPE_CHARS = /\\./ 9 | ESCAPE_BRACKETS = /\(\?[:=!]|\[[^\]]+\]/ 10 | BRACKETS = /\(/ 11 | KEYS = "~" 12 | 13 | def initialize(values, flags = nil) 14 | @values = [] 15 | values.each { |key, value| @values << Item.new(key, value) } 16 | if flags && flags.is_a(String) 17 | @ignore_case = !!(flags =~ /i/) 18 | end 19 | end 20 | 21 | def union(*args) 22 | values = {} 23 | @values.each { |item| values[item.expression] = item.replacement } 24 | args.each do |arg| 25 | arg.values.each { |item| values[item.expression] = item.replacement } 26 | end 27 | self.class.new(values) 28 | end 29 | 30 | def exec(string, &replacement) 31 | string = string.to_s 32 | regexp = value_of 33 | 34 | replacement ||= lambda do |match| 35 | return "" if match.nil? 36 | arguments = [match] + $~.captures + [$~.begin(0), string] 37 | offset, result = 1, "" 38 | @values.each do |item| 39 | nxt = offset + item.length + 1 40 | if arguments[offset] # do we have a result? 41 | rep = item.replacement 42 | if rep.is_a?(Proc) 43 | args = arguments[offset...nxt] 44 | index = arguments[-2] 45 | result = rep.call *(args + [index, string]) 46 | else 47 | result = rep.is_a?(Numeric) ? arguments[offset + rep] : rep.to_s 48 | end 49 | end 50 | offset = nxt 51 | end 52 | result 53 | end 54 | 55 | replacement.is_a?(Proc) ? string.gsub(regexp, &replacement) : 56 | string.gsub(regexp, replacement.to_s) 57 | end 58 | 59 | def test(string) 60 | exec(string) != string 61 | end 62 | 63 | def to_s 64 | length = 0 65 | "(" + @values.map { |item| 66 | # Fix back references. 67 | ref = item.to_s.gsub(BACK_REF) { |m| "\\" + (1 + $1.to_i + length).to_s } 68 | length += item.length + 1 69 | ref 70 | }.join(")|(") + ")" 71 | end 72 | 73 | def value_of(type = nil) 74 | return self if type == Object 75 | flag = @ignore_case ? Regexp::IGNORECASE : nil 76 | Regexp.new(self.to_s, flag) 77 | end 78 | 79 | class Item 80 | attr_accessor :expression, :length, :replacement 81 | 82 | def initialize(expression, replacement) 83 | @expression = expression.is_a?(Regexp) ? expression.source : expression.to_s 84 | 85 | if replacement.is_a?(Numeric) 86 | replacement = "\\" + replacement.to_s 87 | elsif replacement.nil? 88 | replacement = "" 89 | end 90 | 91 | # does the pattern use sub-expressions? 92 | if replacement.is_a?(String) and replacement =~ /\\(\d+)/ 93 | # a simple lookup? (e.g. "\2") 94 | if replacement.gsub(/\n/, " ") =~ /^\\\d+$/ 95 | # store the index (used for fast retrieval of matched strings) 96 | replacement = replacement[1..-1].to_i 97 | else # a complicated lookup (e.g. "Hello \2 \1") 98 | # build a function to do the lookup 99 | q = (replacement.gsub(/\\./, "") =~ /'/) ? '"' : "'" 100 | replacement = replacement.gsub(/\r/, "\\r").gsub(/\\(\d+)/, 101 | q + "+(args[\\1]||" + q+q + ")+" + q) 102 | replacement_string = q + replacement.gsub(/(['"])\1\+(.*)\+\1\1$/, '\1') + q 103 | replacement = lambda { |*args| eval(replacement_string) } 104 | end 105 | end 106 | 107 | @length = RegexpGroup.count(@expression) 108 | @replacement = replacement 109 | end 110 | 111 | def to_s 112 | @expression 113 | end 114 | end 115 | 116 | def self.count(expression) 117 | expression = expression.to_s.gsub(ESCAPE_CHARS, "").gsub(ESCAPE_BRACKETS, "") 118 | expression.scan(BRACKETS).length 119 | end 120 | 121 | end 122 | end 123 | -------------------------------------------------------------------------------- /Support/node_modules/jstransform/README.md: -------------------------------------------------------------------------------- 1 | # JSTransform [![Build Status](https://travis-ci.org/facebook/jstransform.svg?branch=master)](https://travis-ci.org/facebook/jstransform) 2 | 3 | A simple utility for pluggable JS syntax transforms using the esprima parser. 4 | 5 | * Makes it simple to write and plug-in syntax transformations 6 | * Makes it simple to coalesce multiple syntax transformations in a single pass of the AST 7 | * Gives complete control over the formatting of the output on a per-transformation basis 8 | * Supports source map generation 9 | * Comes pre-bundled with a small set of (optional) ES6 -> ES5 transforms 10 | 11 | NOTE: If you're looking for a library for writing new greenfield JS transformations, consider looking at the [Recast](https://github.com/benjamn/recast) library instead of jstransform. We are still actively supporting jstransform (and intend to for the foreseeable future), but longer term we would like to direct efforts toward Recast. Recast does a far better job of supporting a multi-pass JS transformation pipeline, and this is important when attempting to apply many transformations to a source file. 12 | 13 | ## Examples 14 | Using a pre-bundled or existing transform: 15 | ```js 16 | /** 17 | * Reads a source file that may (or may not) contain ES6 classes, transforms it 18 | * to ES5 compatible code using the pre-bundled ES6 class visitors, and prints 19 | * out the result. 20 | */ 21 | var es6ClassVisitors = require('jstransform/visitors/es6-class-visitors').visitorList; 22 | var fs = require('fs'); 23 | var jstransform = require('jstransform'); 24 | 25 | var originalFileContents = fs.readFileSync('path/to/original/file.js', 'utf-8'); 26 | 27 | var transformedFileData = jstransform.transform( 28 | es6ClassVisitors, 29 | originalFileContents 30 | ); 31 | 32 | console.log(transformedFileData.code); 33 | ``` 34 | 35 | Using multiple pre-bundled or existing transforms at once: 36 | ```js 37 | /** 38 | * Reads a source file that may (or may not) contain ES6 classes *or* arrow 39 | * functions, transforms them to ES5 compatible code using the pre-bundled ES6 40 | * visitors, and prints out the result. 41 | */ 42 | var es6ArrowFuncVisitors = require('jstransform/visitors/es6-arrow-function-visitors').visitorList; 43 | var es6ClassVisitors = require('jstransform/visitors/es6-class-visitors').visitorList; 44 | var jstransform = require('jstransform'); 45 | 46 | // Normally you'd read this from the filesystem, but I'll just use a string here 47 | // to simplify the example. 48 | var originalFileContents = "var a = (param1) => param1; class FooClass {}"; 49 | 50 | var transformedFileData = jstransform.transform( 51 | es6ClassVisitors.concat(es6ArrowFuncVisitors), 52 | originalFileContents 53 | ); 54 | 55 | // var a = function(param1) {return param1;}; function FooClass(){"use strict";} 56 | console.log(transformedFileData.code); 57 | ``` 58 | 59 | Writing a simple custom transform: 60 | ```js 61 | /** 62 | * Creates a custom transformation visitor that prefixes all calls to the 63 | * `eval()` function with a call to `alert()` saying how much of a clown you are 64 | * for using eval. 65 | */ 66 | var jstransform = require('jstransform'); 67 | var utils = require('jstransform/src/utils'); 68 | 69 | var Syntax = jstransform.Syntax; 70 | 71 | function visitEvalCallExpressions(traverse, node, path, state) { 72 | // Appends an alert() call to the output buffer *before* the visited node 73 | // (in this case the eval call) is appended to the output buffer 74 | utils.append('alert("...eval?...really?...");', state); 75 | 76 | // Now we copy the eval expression to the output buffer from the original 77 | // source 78 | utils.catchup(node.range[1], state); 79 | } 80 | visitEvalCallExpressions.test = function(node, path, state) { 81 | return node.type === Syntax.CallExpression 82 | && node.callee.type === Syntax.Identifier 83 | && node.callee.name === 'eval'; 84 | }; 85 | 86 | // Normally you'd read this from the filesystem, but I'll just use a string here 87 | // to simplify the example. 88 | var originalFileContents = "eval('foo');"; 89 | 90 | var transformedFileData = jstransform.transform( 91 | [visitEvalCallExpressions], // Multiple visitors may be applied at once, so an 92 | // array is always expected for the first argument 93 | originalFileContents 94 | ); 95 | 96 | // alert("...eval?...really?...");eval('foo'); 97 | console.log(transformedFileData.code); 98 | ``` 99 | -------------------------------------------------------------------------------- /Support/bin/js-beautify/sanitytest.js: -------------------------------------------------------------------------------- 1 | // 2 | // simple testing interface 3 | // written by Einar Lielmanis, einar@jsbeautifier.org 4 | // 5 | // usage: 6 | // 7 | // var t = new SanityTest(function (x) { return x; }, 'my function'); 8 | // t.expect('input', 'output'); 9 | // t.expect('a', 'a'); 10 | // output_somewhere(t.results()); // good for
, html safe-ish
 11 | // alert(t.results_raw());        // html unescaped
 12 | 
 13 | 
 14 | function SanityTest (func, test_name) {
 15 | 
 16 |     var test_func = func || function (x) {
 17 |         return x;
 18 |     }
 19 | 
 20 |     var test_name = test_name || '';
 21 | 
 22 |     var n_failed = 0;
 23 |     var n_succeeded = 0;
 24 | 
 25 |     var failures = [];
 26 | 
 27 |     this.test_function = function(func, name) {
 28 |         test_func = func;
 29 |         test_name = name || '';
 30 |     }
 31 | 
 32 | 
 33 |     this.expect = function(parameters, expected_value) {
 34 |         // multi-parameter calls not supported (I don't need them now).
 35 |         var result = test_func(parameters);
 36 |         // proper array checking is a pain. i'll do it later, compare strings representations instead
 37 |         if ((result === expected_value) || (expected_value instanceof Array && result.join(', ') == expected_value.join(', '))) { 
 38 |             n_succeeded += 1;
 39 |         } else {
 40 |             n_failed += 1;
 41 |             failures.push([test_name, parameters, expected_value, result]);
 42 |         }
 43 |     }
 44 | 
 45 | 
 46 |     this.results_raw = function() {
 47 |         var results = '';
 48 |         if (n_failed === 0) {
 49 |             if (n_succeeded === 0) {
 50 |                 results = 'No tests run.'; 
 51 |             } else {
 52 |                 results = 'All ' + n_succeeded + ' tests passed.';
 53 |             }
 54 |         } else {
 55 |             for (var i = 0 ; i < failures.length; i++) {
 56 |                 var f = failures[i];
 57 |                 if (f[0]) {
 58 |                     f[0] = f[0] + ' ';
 59 |                 }
 60 |                 results += '---- ' + f[0] + 'input -------\n' + this.prettyprint(f[1]) + '\n';
 61 |                 results += '---- ' + f[0] + 'expected ----\n' + this.prettyprint(f[2]) + '\n';
 62 |                 results += '---- ' + f[0] + 'output ------\n' + this.prettyprint(f[3]) + '\n\n';
 63 | 
 64 |             }
 65 |             results += n_failed + ' tests failed.\n';
 66 |         }
 67 |         return results;
 68 |     }
 69 | 
 70 | 
 71 |     this.results = function() {
 72 |         return this.lazy_escape(this.results_raw());
 73 |     }
 74 | 
 75 |     
 76 |     this.prettyprint = function(something, quote_strings) {
 77 |         var type = typeof something;
 78 |         switch(type.toLowerCase()) {
 79 |         case 'string':
 80 |             if (quote_strings) {
 81 |                 return "'" + something.replace("'", "\\'") + "'";
 82 |             } else {
 83 |                 return something;
 84 |             }
 85 |         case 'number':
 86 |             return '' + something;
 87 |         case 'boolean':
 88 |             return something ? 'true' : 'false';
 89 |         case 'undefined':
 90 |             return 'undefined';
 91 |         case 'object':
 92 |             if (something instanceof Array) {
 93 |                 var x = [];
 94 |                 var expected_index = 0;
 95 |                 for (k in something) {
 96 |                     if (k == expected_index) {
 97 |                         x.push(this.prettyprint(something[k], true));
 98 |                         expected_index += 1;
 99 |                     } else {
100 |                         x.push('\n' + k + ': ' + this.prettyprint(something[k], true));
101 |                     }
102 |                 }
103 |                 return '[' + x.join(', ') + ']';
104 |             } else {
105 |                 return 'object: ' + something; 
106 |             }
107 |         default:
108 |             return type + ': ' + something;
109 |         }
110 |     }
111 | 
112 | 
113 |     this.lazy_escape = function (str) {
114 |         return str.replace(//g, '>').replace(/\n/g, '
'); 115 | } 116 | 117 | 118 | this.log = function () { 119 | if (window.console) { 120 | if (console.firebug) { 121 | console.log.apply(console, Array.prototype.slice.call(arguments)); 122 | } else { 123 | console.log.call(console, Array.prototype.slice.call(arguments)); 124 | } 125 | } 126 | }; 127 | 128 | } 129 | -------------------------------------------------------------------------------- /Support/node_modules/js-beautify-node/tests/sanitytest.js: -------------------------------------------------------------------------------- 1 | // 2 | // simple testing interface 3 | // written by Einar Lielmanis, einar@jsbeautifier.org 4 | // 5 | // usage: 6 | // 7 | // var t = new SanityTest(function (x) { return x; }, 'my function'); 8 | // t.expect('input', 'output'); 9 | // t.expect('a', 'a'); 10 | // output_somewhere(t.results()); // good for
, html safe-ish
 11 | // alert(t.results_raw());        // html unescaped
 12 | 
 13 | 
 14 | function SanityTest (func, test_name) {
 15 | 
 16 |     var test_func = func || function (x) {
 17 |         return x;
 18 |     }
 19 | 
 20 |     var test_name = test_name || '';
 21 | 
 22 |     var n_failed = 0;
 23 |     var n_succeeded = 0;
 24 | 
 25 |     var failures = [];
 26 | 
 27 |     this.test_function = function(func, name) {
 28 |         test_func = func;
 29 |         test_name = name || '';
 30 |     }
 31 | 
 32 | 
 33 |     this.expect = function(parameters, expected_value) {
 34 |         // multi-parameter calls not supported (I don't need them now).
 35 |         var result = test_func(parameters);
 36 |         // proper array checking is a pain. i'll maybe do it later, compare strings representations instead
 37 |         if ((result === expected_value) || (expected_value instanceof Array && result.join(', ') == expected_value.join(', '))) {
 38 |             n_succeeded += 1;
 39 |         } else {
 40 |             n_failed += 1;
 41 |             failures.push([test_name, parameters, expected_value, result]);
 42 |         }
 43 |     }
 44 | 
 45 | 
 46 |     this.results_raw = function() {
 47 |         var results = '';
 48 |         if (n_failed === 0) {
 49 |             if (n_succeeded === 0) {
 50 |                 results = 'No tests run.';
 51 |             } else {
 52 |                 results = 'All ' + n_succeeded + ' tests passed.';
 53 |             }
 54 |         } else {
 55 |             for (var i = 0 ; i < failures.length; i++) {
 56 |                 var f = failures[i];
 57 |                 if (f[0]) {
 58 |                     f[0] = f[0] + ' ';
 59 |                 }
 60 |                 results += '---- ' + f[0] + 'input -------\n' + this.prettyprint(f[1]) + '\n';
 61 |                 results += '---- ' + f[0] + 'expected ----\n' + this.prettyprint(f[2]) + '\n';
 62 |                 results += '---- ' + f[0] + 'output ------\n' + this.prettyprint(f[3]) + '\n\n';
 63 | 
 64 |             }
 65 |             results += n_failed + ' tests failed.\n';
 66 |         }
 67 |         return results;
 68 |     }
 69 | 
 70 | 
 71 |     this.results = function() {
 72 |         return this.lazy_escape(this.results_raw());
 73 |     }
 74 | 
 75 | 
 76 |     this.prettyprint = function(something, quote_strings) {
 77 |         var type = typeof something;
 78 |         switch(type.toLowerCase()) {
 79 |         case 'string':
 80 |             if (quote_strings) {
 81 |                 return "'" + something.replace("'", "\\'") + "'";
 82 |             } else {
 83 |                 return something;
 84 |             }
 85 |         case 'number':
 86 |             return '' + something;
 87 |         case 'boolean':
 88 |             return something ? 'true' : 'false';
 89 |         case 'undefined':
 90 |             return 'undefined';
 91 |         case 'object':
 92 |             if (something instanceof Array) {
 93 |                 var x = [];
 94 |                 var expected_index = 0;
 95 |                 for (k in something) {
 96 |                     if (k == expected_index) {
 97 |                         x.push(this.prettyprint(something[k], true));
 98 |                         expected_index += 1;
 99 |                     } else {
100 |                         x.push('\n' + k + ': ' + this.prettyprint(something[k], true));
101 |                     }
102 |                 }
103 |                 return '[' + x.join(', ') + ']';
104 |             } else {
105 |                 return 'object: ' + something;
106 |             }
107 |         default:
108 |             return type + ': ' + something;
109 |         }
110 |     }
111 | 
112 | 
113 |     this.lazy_escape = function (str) {
114 |         return str.replace(//g, '>').replace(/\n/g, '
'); 115 | } 116 | 117 | 118 | this.log = function () { 119 | if (window.console) { 120 | if (console.firebug) { 121 | console.log.apply(console, Array.prototype.slice.call(arguments)); 122 | } else { 123 | console.log.call(console, Array.prototype.slice.call(arguments)); 124 | } 125 | } 126 | }; 127 | 128 | } 129 | -------------------------------------------------------------------------------- /Support/bin/TextMate.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | /*jshint asi:true*/ 3 | 4 | exports.href = function(path, line, column){ 5 | return "txmt://open?url=file://" + path + '&line='+line + '&column='+column 6 | } 7 | 8 | // exports.pathRegExp = RegExp('^' + process.env.HOME + '.*?\.js(?::(\d+)(?::(\d+))?)?', 'g'); 9 | // exports.pathRegExp = /\B((?:\/\b(?:[\(\)\w._-]+(?:\b \b[\(\)\w._-]+)*\b)){2,})(?!>)(?::(\d+)(?::(\d+))?)?/g; 10 | exports.pathRegExp = /(\/(?:sbin|home|net|tmp|System|opt|Network|usr|private|Users|Volumes|bin|Library|Applications)\/.+?\.(?:json|js|jsx|jsxinc|xjs|coffee))(?::(\d+)(?::(\d+))?)?/g; 11 | 12 | exports.linkPaths = function(html){ 13 | return String(html) 14 | // .replace(/(\.*\/[^\n(){},'"]+?):(\d+)(?::(\d+))?/g, exports.linkPath) 15 | // .replace(exports.pathRegExp, exports.linkPath) 16 | .replace(exports.pathRegExp, exports.linkPath) 17 | 18 | /* 19 | YES 20 | /foo 21 | NO 22 | f/foo 23 | //aasdas 24 | */ 25 | } 26 | 27 | exports.linkPath = function(match, path, line, column){ 28 | return '' + match.replace(process.env.TM_DIRECTORY+'/', '') + '' 29 | } 30 | 31 | exports.uniqueColorFor_cache = {} 32 | exports.uniqueColorFor = function(thing){ 33 | return exports.uniqueColorFor_cache[thing] || (exports.uniqueColorFor_cache[thing] = 'hsl(' + Math.random() * 360 + ', 50%, 50%)') 34 | } 35 | 36 | var matchHome = RegExp(process.env.HOME,'g') 37 | 38 | exports.expandFileNameToPath = function(fileName){ 39 | return process.installPrefix + '/lib/' + fileName 40 | } 41 | 42 | if (module.id == '.') { 43 | require('assert').equal( 44 | exports.linkPaths('/Users/thomas/Projects/Sencha/SDK/build/bin/build-bootstraps-2.js:90:60'), 45 | exports.linkPath('/Users/thomas/Projects/Sencha/SDK/build/bin/build-bootstraps-2.js:90:60' 46 | ,'/Users/thomas/Projects/Sencha/SDK/build/bin/build-bootstraps-2.js',90,60) 47 | ) 48 | 49 | require('assert').equal( 50 | exports.linkPaths 51 | ("node.js:183\n\ 52 | throw e; // process.nextTick error, or 'error' event on first tick\n\ 53 | ^\n\ 54 | TypeError: Cannot read property 'className' of undefined\n\ 55 | at isClobberedBy (/Users/thomas/Projects/Sencha/SDK/build/lib/discover-metaclass.js:114:14)\n\ 56 | at isClobberedBy (/Users/thomas/Projects/Sencha/SDK/build/lib/discover-metaclass.js:119:15)\n\ 57 | at isClobberedBy (/Users/thomas/Projects/Sencha/SDK/build/lib/discover-metaclass.js:119:15)\n\ 58 | at Function.isClobberedBy (/Users/thomas/Projects/Sencha/SDK/build/lib/discover-metaclass.js:119:15)\n\ 59 | at Object. (/Users/thomas/Projects/Sencha/SDK/build/lib/discover-metaclass.js:166:32)\n\ 60 | at Module._compile (module.js:423:26)\n\ 61 | at Object..js (module.js:429:10)\n\ 62 | at Module.load (module.js:339:31)\n\ 63 | at Function._load (module.js:298:12)\n\ 64 | at Array. (module.js:442:10)" 65 | ).match(/txmt:/g).length 66 | ,5 67 | ) 68 | 69 | require('assert').equal( 70 | exports.linkPaths('/Users/aylott/Dropbox/Work/node-headless-inspector/demo-chrome.js:17:22'), 71 | exports.linkPath('/Users/aylott/Dropbox/Work/node-headless-inspector/demo-chrome.js:17:22' 72 | ,'/Users/aylott/Dropbox/Work/node-headless-inspector/demo-chrome.js',17,22) 73 | ) 74 | 75 | // require('assert').equal( 76 | // exports.linkPaths('/Users/aylott/Dropbox (Personal)/Work/node-headless-inspector/demo-chrome.js:17:22'), 77 | // exports.linkPath('/Users/aylott/Dropbox (Personal)/Work/node-headless-inspector/demo-chrome.js:17:22' 78 | // ,'/Users/aylott/Dropbox (Personal)/Work/node-headless-inspector/demo-chrome.js',17,22) 79 | // ) 80 | 81 | try { 82 | var action = process.argv[2] || process.env.TM_SELECTED_TEXT 83 | var args = process.argv.slice(3) 84 | 85 | if (exports[action]) { 86 | process.stdin.resume(); 87 | process.stdin.on('data', function(data){ 88 | process.stdout.write(exports[action].apply(null, [data].concat(args))) 89 | }) 90 | } else { 91 | console.warn(exports) 92 | } 93 | } catch(e){ 94 | console.error(exports) 95 | process.exit(1) 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /Support/node_modules/jstransform/node_modules/esprima-fb/bin/esparse.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | /* 3 | Copyright (C) 2012 Ariya Hidayat 4 | Copyright (C) 2011 Ariya Hidayat 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | * Redistributions of source code must retain the above copyright 10 | notice, this list of conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright 12 | notice, this list of conditions and the following disclaimer in the 13 | documentation and/or other materials provided with the distribution. 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY 19 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 | THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | /*jslint sloppy:true node:true rhino:true */ 28 | 29 | var fs, esprima, fname, content, options, syntax; 30 | 31 | if (typeof require === 'function') { 32 | fs = require('fs'); 33 | esprima = require('esprima'); 34 | } else if (typeof load === 'function') { 35 | try { 36 | load('esprima.js'); 37 | } catch (e) { 38 | load('../esprima.js'); 39 | } 40 | } 41 | 42 | // Shims to Node.js objects when running under Rhino. 43 | if (typeof console === 'undefined' && typeof process === 'undefined') { 44 | console = { log: print }; 45 | fs = { readFileSync: readFile }; 46 | process = { argv: arguments, exit: quit }; 47 | process.argv.unshift('esparse.js'); 48 | process.argv.unshift('rhino'); 49 | } 50 | 51 | function showUsage() { 52 | console.log('Usage:'); 53 | console.log(' esparse [options] file.js'); 54 | console.log(); 55 | console.log('Available options:'); 56 | console.log(); 57 | console.log(' --comment Gather all line and block comments in an array'); 58 | console.log(' --loc Include line-column location info for each syntax node'); 59 | console.log(' --range Include index-based range for each syntax node'); 60 | console.log(' --raw Display the raw value of literals'); 61 | console.log(' --tokens List all tokens in an array'); 62 | console.log(' --tolerant Tolerate errors on a best-effort basis (experimental)'); 63 | console.log(' -v, --version Shows program version'); 64 | console.log(); 65 | process.exit(1); 66 | } 67 | 68 | if (process.argv.length <= 2) { 69 | showUsage(); 70 | } 71 | 72 | options = {}; 73 | 74 | process.argv.splice(2).forEach(function (entry) { 75 | 76 | if (entry === '-h' || entry === '--help') { 77 | showUsage(); 78 | } else if (entry === '-v' || entry === '--version') { 79 | console.log('ECMAScript Parser (using Esprima version', esprima.version, ')'); 80 | console.log(); 81 | process.exit(0); 82 | } else if (entry === '--comment') { 83 | options.comment = true; 84 | } else if (entry === '--loc') { 85 | options.loc = true; 86 | } else if (entry === '--range') { 87 | options.range = true; 88 | } else if (entry === '--raw') { 89 | options.raw = true; 90 | } else if (entry === '--tokens') { 91 | options.tokens = true; 92 | } else if (entry === '--tolerant') { 93 | options.tolerant = true; 94 | } else if (entry.slice(0, 2) === '--') { 95 | console.log('Error: unknown option ' + entry + '.'); 96 | process.exit(1); 97 | } else if (typeof fname === 'string') { 98 | console.log('Error: more than one input file.'); 99 | process.exit(1); 100 | } else { 101 | fname = entry; 102 | } 103 | }); 104 | 105 | if (typeof fname !== 'string') { 106 | console.log('Error: no input file.'); 107 | process.exit(1); 108 | } 109 | 110 | try { 111 | content = fs.readFileSync(fname, 'utf-8'); 112 | syntax = esprima.parse(content, options); 113 | console.log(JSON.stringify(syntax, null, 4)); 114 | } catch (e) { 115 | console.log('Error: ' + e.message); 116 | process.exit(1); 117 | } 118 | -------------------------------------------------------------------------------- /Support/node_modules/jstransform/node_modules/source-map/Makefile.dryice.js: -------------------------------------------------------------------------------- 1 | /* -*- Mode: js; js-indent-level: 2; -*- */ 2 | /* 3 | * Copyright 2011 Mozilla Foundation and contributors 4 | * Licensed under the New BSD license. See LICENSE or: 5 | * http://opensource.org/licenses/BSD-3-Clause 6 | */ 7 | var path = require('path'); 8 | var fs = require('fs'); 9 | var copy = require('dryice').copy; 10 | 11 | function removeAmdefine(src) { 12 | src = String(src).replace( 13 | /if\s*\(typeof\s*define\s*!==\s*'function'\)\s*{\s*var\s*define\s*=\s*require\('amdefine'\)\(module,\s*require\);\s*}\s*/g, 14 | ''); 15 | src = src.replace( 16 | /\b(define\(.*)('amdefine',?)/gm, 17 | '$1'); 18 | return src; 19 | } 20 | removeAmdefine.onRead = true; 21 | 22 | function makeNonRelative(src) { 23 | return src 24 | .replace(/require\('.\//g, 'require(\'source-map/') 25 | .replace(/\.\.\/\.\.\/lib\//g, ''); 26 | } 27 | makeNonRelative.onRead = true; 28 | 29 | function buildBrowser() { 30 | console.log('\nCreating dist/source-map.js'); 31 | 32 | var project = copy.createCommonJsProject({ 33 | roots: [ path.join(__dirname, 'lib') ] 34 | }); 35 | 36 | copy({ 37 | source: [ 38 | 'build/mini-require.js', 39 | { 40 | project: project, 41 | require: [ 'source-map/source-map-generator', 42 | 'source-map/source-map-consumer', 43 | 'source-map/source-node'] 44 | }, 45 | 'build/suffix-browser.js' 46 | ], 47 | filter: [ 48 | copy.filter.moduleDefines, 49 | removeAmdefine 50 | ], 51 | dest: 'dist/source-map.js' 52 | }); 53 | } 54 | 55 | function buildBrowserMin() { 56 | console.log('\nCreating dist/source-map.min.js'); 57 | 58 | copy({ 59 | source: 'dist/source-map.js', 60 | filter: copy.filter.uglifyjs, 61 | dest: 'dist/source-map.min.js' 62 | }); 63 | } 64 | 65 | function buildFirefox() { 66 | console.log('\nCreating dist/SourceMap.jsm'); 67 | 68 | var project = copy.createCommonJsProject({ 69 | roots: [ path.join(__dirname, 'lib') ] 70 | }); 71 | 72 | copy({ 73 | source: [ 74 | 'build/prefix-source-map.jsm', 75 | { 76 | project: project, 77 | require: [ 'source-map/source-map-consumer', 78 | 'source-map/source-map-generator', 79 | 'source-map/source-node' ] 80 | }, 81 | 'build/suffix-source-map.jsm' 82 | ], 83 | filter: [ 84 | copy.filter.moduleDefines, 85 | removeAmdefine, 86 | makeNonRelative 87 | ], 88 | dest: 'dist/SourceMap.jsm' 89 | }); 90 | 91 | // Create dist/test/Utils.jsm 92 | console.log('\nCreating dist/test/Utils.jsm'); 93 | 94 | project = copy.createCommonJsProject({ 95 | roots: [ __dirname, path.join(__dirname, 'lib') ] 96 | }); 97 | 98 | copy({ 99 | source: [ 100 | 'build/prefix-utils.jsm', 101 | 'build/assert-shim.js', 102 | { 103 | project: project, 104 | require: [ 'test/source-map/util' ] 105 | }, 106 | 'build/suffix-utils.jsm' 107 | ], 108 | filter: [ 109 | copy.filter.moduleDefines, 110 | removeAmdefine, 111 | makeNonRelative 112 | ], 113 | dest: 'dist/test/Utils.jsm' 114 | }); 115 | 116 | function isTestFile(f) { 117 | return /^test\-.*?\.js/.test(f); 118 | } 119 | 120 | var testFiles = fs.readdirSync(path.join(__dirname, 'test', 'source-map')).filter(isTestFile); 121 | 122 | testFiles.forEach(function (testFile) { 123 | console.log('\nCreating', path.join('dist', 'test', testFile.replace(/\-/g, '_'))); 124 | 125 | copy({ 126 | source: [ 127 | 'build/test-prefix.js', 128 | path.join('test', 'source-map', testFile), 129 | 'build/test-suffix.js' 130 | ], 131 | filter: [ 132 | removeAmdefine, 133 | makeNonRelative, 134 | function (input, source) { 135 | return input.replace('define(', 136 | 'define("' 137 | + path.join('test', 'source-map', testFile.replace(/\.js$/, '')) 138 | + '", ["require", "exports", "module"], '); 139 | }, 140 | function (input, source) { 141 | return input.replace('{THIS_MODULE}', function () { 142 | return "test/source-map/" + testFile.replace(/\.js$/, ''); 143 | }); 144 | } 145 | ], 146 | dest: path.join('dist', 'test', testFile.replace(/\-/g, '_')) 147 | }); 148 | }); 149 | } 150 | 151 | function ensureDir(name) { 152 | var dirExists = false; 153 | try { 154 | dirExists = fs.statSync(name).isDirectory(); 155 | } catch (err) {} 156 | 157 | if (!dirExists) { 158 | fs.mkdirSync(name, 0777); 159 | } 160 | } 161 | 162 | ensureDir("dist"); 163 | ensureDir("dist/test"); 164 | buildFirefox(); 165 | buildBrowser(); 166 | buildBrowserMin(); 167 | -------------------------------------------------------------------------------- /Support/node_modules/jstransform/node_modules/source-map/build/mini-require.js: -------------------------------------------------------------------------------- 1 | /* -*- Mode: js; js-indent-level: 2; -*- */ 2 | /* 3 | * Copyright 2011 Mozilla Foundation and contributors 4 | * Licensed under the New BSD license. See LICENSE or: 5 | * http://opensource.org/licenses/BSD-3-Clause 6 | */ 7 | 8 | /** 9 | * Define a module along with a payload. 10 | * @param {string} moduleName Name for the payload 11 | * @param {ignored} deps Ignored. For compatibility with CommonJS AMD Spec 12 | * @param {function} payload Function with (require, exports, module) params 13 | */ 14 | function define(moduleName, deps, payload) { 15 | if (typeof moduleName != "string") { 16 | throw new TypeError('Expected string, got: ' + moduleName); 17 | } 18 | 19 | if (arguments.length == 2) { 20 | payload = deps; 21 | } 22 | 23 | if (moduleName in define.modules) { 24 | throw new Error("Module already defined: " + moduleName); 25 | } 26 | define.modules[moduleName] = payload; 27 | }; 28 | 29 | /** 30 | * The global store of un-instantiated modules 31 | */ 32 | define.modules = {}; 33 | 34 | 35 | /** 36 | * We invoke require() in the context of a Domain so we can have multiple 37 | * sets of modules running separate from each other. 38 | * This contrasts with JSMs which are singletons, Domains allows us to 39 | * optionally load a CommonJS module twice with separate data each time. 40 | * Perhaps you want 2 command lines with a different set of commands in each, 41 | * for example. 42 | */ 43 | function Domain() { 44 | this.modules = {}; 45 | this._currentModule = null; 46 | } 47 | 48 | (function () { 49 | 50 | /** 51 | * Lookup module names and resolve them by calling the definition function if 52 | * needed. 53 | * There are 2 ways to call this, either with an array of dependencies and a 54 | * callback to call when the dependencies are found (which can happen 55 | * asynchronously in an in-page context) or with a single string an no callback 56 | * where the dependency is resolved synchronously and returned. 57 | * The API is designed to be compatible with the CommonJS AMD spec and 58 | * RequireJS. 59 | * @param {string[]|string} deps A name, or names for the payload 60 | * @param {function|undefined} callback Function to call when the dependencies 61 | * are resolved 62 | * @return {undefined|object} The module required or undefined for 63 | * array/callback method 64 | */ 65 | Domain.prototype.require = function(deps, callback) { 66 | if (Array.isArray(deps)) { 67 | var params = deps.map(function(dep) { 68 | return this.lookup(dep); 69 | }, this); 70 | if (callback) { 71 | callback.apply(null, params); 72 | } 73 | return undefined; 74 | } 75 | else { 76 | return this.lookup(deps); 77 | } 78 | }; 79 | 80 | function normalize(path) { 81 | var bits = path.split('/'); 82 | var i = 1; 83 | while (i < bits.length) { 84 | if (bits[i] === '..') { 85 | bits.splice(i-1, 1); 86 | } else if (bits[i] === '.') { 87 | bits.splice(i, 1); 88 | } else { 89 | i++; 90 | } 91 | } 92 | return bits.join('/'); 93 | } 94 | 95 | function join(a, b) { 96 | a = a.trim(); 97 | b = b.trim(); 98 | if (/^\//.test(b)) { 99 | return b; 100 | } else { 101 | return a.replace(/\/*$/, '/') + b; 102 | } 103 | } 104 | 105 | function dirname(path) { 106 | var bits = path.split('/'); 107 | bits.pop(); 108 | return bits.join('/'); 109 | } 110 | 111 | /** 112 | * Lookup module names and resolve them by calling the definition function if 113 | * needed. 114 | * @param {string} moduleName A name for the payload to lookup 115 | * @return {object} The module specified by aModuleName or null if not found. 116 | */ 117 | Domain.prototype.lookup = function(moduleName) { 118 | if (/^\./.test(moduleName)) { 119 | moduleName = normalize(join(dirname(this._currentModule), moduleName)); 120 | } 121 | 122 | if (moduleName in this.modules) { 123 | var module = this.modules[moduleName]; 124 | return module; 125 | } 126 | 127 | if (!(moduleName in define.modules)) { 128 | throw new Error("Module not defined: " + moduleName); 129 | } 130 | 131 | var module = define.modules[moduleName]; 132 | 133 | if (typeof module == "function") { 134 | var exports = {}; 135 | var previousModule = this._currentModule; 136 | this._currentModule = moduleName; 137 | module(this.require.bind(this), exports, { id: moduleName, uri: "" }); 138 | this._currentModule = previousModule; 139 | module = exports; 140 | } 141 | 142 | // cache the resulting module object for next time 143 | this.modules[moduleName] = module; 144 | 145 | return module; 146 | }; 147 | 148 | }()); 149 | 150 | define.Domain = Domain; 151 | define.globalDomain = new Domain(); 152 | var require = define.globalDomain.require.bind(define.globalDomain); 153 | -------------------------------------------------------------------------------- /Support/node_modules/jstransform/visitors/es6-arrow-function-visitors.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2013 Facebook, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /*global exports:true*/ 18 | 19 | /** 20 | * Desugars ES6 Arrow functions to ES3 function expressions. 21 | * If the function contains `this` expression -- automatically 22 | * binds the function to current value of `this`. 23 | * 24 | * Single parameter, simple expression: 25 | * 26 | * [1, 2, 3].map(x => x * x); 27 | * 28 | * [1, 2, 3].map(function(x) { return x * x; }); 29 | * 30 | * Several parameters, complex block: 31 | * 32 | * this.users.forEach((user, idx) => { 33 | * return this.isActive(idx) && this.send(user); 34 | * }); 35 | * 36 | * this.users.forEach(function(user, idx) { 37 | * return this.isActive(idx) && this.send(user); 38 | * }.bind(this)); 39 | * 40 | */ 41 | var restParamVisitors = require('./es6-rest-param-visitors'); 42 | var destructuringVisitors = require('./es6-destructuring-visitors'); 43 | 44 | var Syntax = require('esprima-fb').Syntax; 45 | var utils = require('../src/utils'); 46 | 47 | /** 48 | * @public 49 | */ 50 | function visitArrowFunction(traverse, node, path, state) { 51 | var notInExpression = (path[0].type === Syntax.ExpressionStatement); 52 | 53 | // Wrap a function into a grouping operator, if it's not 54 | // in the expression position. 55 | if (notInExpression) { 56 | utils.append('(', state); 57 | } 58 | 59 | utils.append('function', state); 60 | renderParams(traverse, node, path, state); 61 | 62 | // Skip arrow. 63 | utils.catchupWhiteSpace(node.body.range[0], state); 64 | 65 | var renderBody = node.body.type == Syntax.BlockStatement 66 | ? renderStatementBody 67 | : renderExpressionBody; 68 | 69 | path.unshift(node); 70 | renderBody(traverse, node, path, state); 71 | path.shift(); 72 | 73 | // Bind the function only if `this` value is used 74 | // inside it or inside any sub-expression. 75 | var containsBindingSyntax = 76 | utils.containsChildMatching(node.body, function(node) { 77 | return node.type === Syntax.ThisExpression 78 | || (node.type === Syntax.Identifier 79 | && node.name === "super"); 80 | }); 81 | 82 | if (containsBindingSyntax) { 83 | utils.append('.bind(this)', state); 84 | } 85 | 86 | utils.catchupWhiteSpace(node.range[1], state); 87 | 88 | // Close wrapper if not in the expression. 89 | if (notInExpression) { 90 | utils.append(')', state); 91 | } 92 | 93 | return false; 94 | } 95 | 96 | function renderParams(traverse, node, path, state) { 97 | // To preserve inline typechecking directives, we 98 | // distinguish between parens-free and paranthesized single param. 99 | if (isParensFreeSingleParam(node, state) || !node.params.length) { 100 | utils.append('(', state); 101 | } 102 | if (node.params.length !== 0) { 103 | path.unshift(node); 104 | traverse(node.params, path, state); 105 | path.unshift(); 106 | } 107 | utils.append(')', state); 108 | } 109 | 110 | function isParensFreeSingleParam(node, state) { 111 | return node.params.length === 1 && 112 | state.g.source[state.g.position] !== '('; 113 | } 114 | 115 | function renderExpressionBody(traverse, node, path, state) { 116 | // Wrap simple expression bodies into a block 117 | // with explicit return statement. 118 | utils.append('{', state); 119 | 120 | // Special handling of rest param. 121 | if (node.rest) { 122 | utils.append( 123 | restParamVisitors.renderRestParamSetup(node, state), 124 | state 125 | ); 126 | } 127 | 128 | // Special handling of destructured params. 129 | destructuringVisitors.renderDestructuredComponents( 130 | node, 131 | utils.updateState(state, { 132 | localScope: { 133 | parentNode: state.parentNode, 134 | parentScope: state.parentScope, 135 | identifiers: state.identifiers, 136 | tempVarIndex: 0 137 | } 138 | }) 139 | ); 140 | 141 | utils.append('return ', state); 142 | renderStatementBody(traverse, node, path, state); 143 | utils.append(';}', state); 144 | } 145 | 146 | function renderStatementBody(traverse, node, path, state) { 147 | traverse(node.body, path, state); 148 | utils.catchup(node.body.range[1], state); 149 | } 150 | 151 | visitArrowFunction.test = function(node, path, state) { 152 | return node.type === Syntax.ArrowFunctionExpression; 153 | }; 154 | 155 | exports.visitorList = [ 156 | visitArrowFunction 157 | ]; 158 | 159 | -------------------------------------------------------------------------------- /Support/conf/jsl.textmate.conf: -------------------------------------------------------------------------------- 1 | # 2 | # Configuration File for JavaScript Lint 0.2.6 3 | # Developed by Matthias Miller (http://www.JavaScriptLint.com) 4 | # 5 | # This configuration file can be used to lint a collection of scripts, or to enable 6 | # or disable warnings for scripts that are linted via the command line. 7 | # 8 | 9 | #### NOTE TO TEXTMATE BUNDLE USERS: 10 | #### Feel free to experiment with enabling/disabling individual warnings to 11 | #### suit your own level of anal-retentiveness. 12 | 13 | ### Warnings 14 | # Enable or disable warnings based on requirements. 15 | # Use "+WarningName" to display or "-WarningName" to suppress. 16 | # 17 | +no_return_value # function {0} does not always return a value 18 | +duplicate_formal # duplicate formal argument {0} 19 | +equal_as_assign # test for equality (==) mistyped as assignment (=)?{0} 20 | +var_hides_arg # variable {0} hides argument 21 | +redeclared_var # redeclaration of {0} {1} 22 | +anon_no_return_value # anonymous function does not always return a value 23 | +missing_semicolon # missing semicolon 24 | +meaningless_block # meaningless block; curly braces have no impact 25 | +comma_separated_stmts # multiple statements separated by commas (use semicolons?) 26 | +unreachable_code # unreachable code 27 | -missing_break # missing break statement 28 | -missing_break_for_last_case # missing break statement for last case in switch 29 | -comparison_type_conv # comparisons against null, 0, or an empty string allowing implicit type conversion (use === or !==) 30 | -inc_dec_within_stmt # increment (++) and decrement (--) operators used as part of greater statement 31 | +useless_void # use of the void type may be unnecessary (void is always undefined) 32 | +multiple_plus_minus # unknown order of operations for successive plus (e.g. x+++y) or minus (e.g. x---y) signs 33 | -use_of_label # use of label 34 | -block_without_braces # block statement without curly braces 35 | +leading_decimal_point # leading decimal point may indicate a number or an object member 36 | +trailing_decimal_point # trailing decimal point may indicate a number or an object member 37 | +octal_number # leading zeros make an octal number 38 | +nested_comment # nested comment 39 | +misplaced_regex # regular expressions should be preceded by a left parenthesis, assignment, colon, or comma 40 | -ambiguous_newline # unexpected end of line; it is ambiguous whether these lines are part of the same statement 41 | -empty_statement # empty statement or extra semicolon 42 | -missing_option_explicit # the "option explicit" control comment is missing 43 | +partial_option_explicit # the "option explicit" control comment, if used, must be in the first script tag 44 | +dup_option_explicit # duplicate "option explicit" control comment 45 | -useless_assign # useless assignment 46 | +ambiguous_nested_stmt # block statements containing block statements should use curly braces to resolve ambiguity 47 | +ambiguous_else_stmt # the else statement could be matched with one of multiple if statements (use curly braces to indicate intent) 48 | -missing_default_case # missing default case in switch statement 49 | +duplicate_case_in_switch # duplicate case in switch statements 50 | +default_not_at_end # the default case is not at the end of the switch statement 51 | +legacy_cc_not_understood # couldn't understand control comment using /*@keyword@*/ syntax 52 | +jsl_cc_not_understood # couldn't understand control comment using /*jsl:keyword*/ syntax 53 | +useless_comparison # useless comparison; comparing identical expressions 54 | 55 | 56 | ### Context 57 | # Show the in-line position of the error. 58 | # Use "+context" to display or "-context" to suppress. 59 | # 60 | +context 61 | 62 | 63 | ### Semicolons 64 | # By default, assignments of an anonymous function to a variable or 65 | # property (such as a function prototype) must be followed by a semicolon. 66 | # 67 | +lambda_assign_requires_semicolon 68 | 69 | 70 | ### Control Comments 71 | # Both JavaScript Lint and the JScript interpreter confuse each other with the syntax for 72 | # the /*@keyword@*/ control comments and JScript conditional comments. (The latter is 73 | # enabled in JScript with @cc_on@). The /*jsl:keyword*/ syntax is preferred for this reason, 74 | # although legacy control comments are enabled by default for backward compatibility. 75 | # 76 | +legacy_control_comments 77 | 78 | 79 | ### Defining identifiers 80 | # By default, "option explicit" is enabled on a per-file basis. 81 | # To enable this for all files, use "+always_use_option_explicit" 82 | -always_use_option_explicit 83 | 84 | # Define certain identifiers of which the lint is not aware. 85 | # (Use this in conjunction with the "undeclared identifier" warning.) 86 | # 87 | # Common uses for webpages might be: 88 | +define window 89 | +define document 90 | 91 | 92 | 93 | #### HEY, YOU REALLY SHOULDN'T CHANGE THIS PART, DUDE, 94 | #### OR IT WILL MESS UP THE REST OF THE BUNDLE: 95 | +output-format __LINE__: __ERROR__ 96 | -------------------------------------------------------------------------------- /Support/bin/packr-1.0.2/README: -------------------------------------------------------------------------------- 1 | == PackR 2 | 3 | PackR is a Ruby port of Dean Edwards' MIT-licensed JavaScript compressor, Packer: 4 | 5 | # Packer version 3.0 (final) - copyright 2004-2007, Dean Edwards 6 | # http://www.opensource.org/licenses/mit-license 7 | http://dean.edwards.name/packer/ 8 | 9 | This version is based on Packer 3.0. You may find that the results it produces 10 | are not strictly identical to those of the JavaScript version, but the difference is 11 | just a question of how the base-62 word list is ordered -- your scripts 12 | will work just like those produced with the online version. The level of 13 | compression achieved is identical between the two versions. 14 | 15 | === Installation 16 | 17 | PackR is available both as a gem and as a Rails plugin. The plugin gives you the 18 | +Packr+ class from the gem, plus some helpful +rake+ tasks to use during Rails 19 | development. To get the gem: 20 | 21 | gem install packr 22 | 23 | To get the Rails plugin: 24 | 25 | ruby script/plugin install 26 | http://svn.jcoglan.com/packr/trunk/packr 27 | 28 | === Usage 29 | 30 | Usage is dead simple. Within your Ruby/Rails app, you can compress pieces of code 31 | like this: 32 | 33 | compressed = Packr.pack(script) 34 | 35 | # Pass options to control the type of compression 36 | compressed = Packr.pack(script, :shrink_vars => true) 37 | compressed = Packr.pack(script, :base62 => true) 38 | compressed = Packr.pack(script, :shrink_vars => true, :base62 => true) 39 | 40 | If you want to compress a particular file, you can do this: 41 | 42 | Packr.pack_file(path, ... options as above ...) 43 | 44 | Be careful with that - it will overwrite the contents of the file with 45 | the packed version. Be a good kid and use version control in case something 46 | goes wrong and you lose all your source code! 47 | 48 | If you want PackR's variable-shrinking routine to preserve certain variable names, 49 | you can tell it to do so by instantiating it and telling it which names you want to 50 | preserve: 51 | 52 | my_packr = Packr.new 53 | my_packr.protect_vars(:some, :variable, :names) 54 | 55 | my_packr.pack('var func = function(foo, bar, some) { return some(foo + bar); }', :shrink_vars => true) 56 | #=> "var func=function(a,b,some){return some(a+b)}" 57 | 58 | If you want to protect the same variables for all scripts your program compresses, 59 | tell the +Packr+ class to protect them: 60 | 61 | Packr.protect_vars(:some, :variable, :names) 62 | 63 | Packr.pack('var func = function(foo, bar, some) { return some(foo + bar); }', :shrink_vars => true) 64 | #=> "var func=function(a,b,some){return some(a+b)}" 65 | 66 | By default, PackR always protects the variable $super so you can compress 67 | Prototype code that uses class inheritance. The constant +PROTECTED_NAMES+ in the 68 | +Packr+ source code controls which variables are protected by default. 69 | 70 | === Automated packing 71 | 72 | When installed as a Rails plugin, PackR also comes with a +rake+ task to let you 73 | batch-pack all your scripts. To use it, store any files you want to serve in 74 | packed form in the directory lib/javascripts. (The idea is that you won't 75 | be serving the source files to the public, so why keep them in the public folder? 76 | Also, it keeps the source files and packed copies nicely separated.) Then run: 77 | 78 | rake packr:pack_libs 79 | 80 | You can specify the type of packing using flags: 81 | 82 | rake packr:pack_libs shrink_vars= 83 | rake packr:pack_libs base62= shrink_vars= 84 | 85 | PackR will put packed copies of all the scripts from lib/javascripts in 86 | public/javascripts. Again, be careful as this will overwrite any pre-existing 87 | files in your public directory. 88 | 89 | It is not recommended to run this as part of your deployment process, as you will 90 | need to verfiy that your JavaScript works when packed before committing it. PackR 91 | works using regular expressions -- not a true JavaScript interpreter -- and cannot 92 | fix missing semicolons for you. 93 | 94 | Also, DO NOT use PackR to compress files on-the-fly in response to HTTP 95 | requests. The packing process can be quite processor-intensive and it will 96 | make you app very slow when serving script files. 97 | 98 | === License 99 | 100 | Copyright (c) 2007 Dean Edwards, James Coglan 101 | 102 | Permission is hereby granted, free of charge, to any person obtaining 103 | a copy of this software and associated documentation files (the "Software"), 104 | to deal in the Software without restriction, including without limitation 105 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 106 | and/or sell copies of the Software, and to permit persons to whom the 107 | Software is furnished to do so, subject to the following conditions: 108 | 109 | The above copyright notice and this permission notice shall be included 110 | in all copies or substantial portions of the Software. 111 | 112 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 113 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 114 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 115 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 116 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 117 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 118 | DEALINGS IN THE SOFTWARE. 119 | -------------------------------------------------------------------------------- /Support/node_modules/jstransform/visitors/es6-template-visitors.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2013 Facebook, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /*jslint node:true*/ 18 | 19 | /** 20 | * @typechecks 21 | */ 22 | 'use strict'; 23 | 24 | var Syntax = require('esprima-fb').Syntax; 25 | var utils = require('../src/utils'); 26 | 27 | /** 28 | * http://people.mozilla.org/~jorendorff/es6-draft.html#sec-12.1.9 29 | */ 30 | function visitTemplateLiteral(traverse, node, path, state) { 31 | var templateElements = node.quasis; 32 | 33 | utils.append('(', state); 34 | for (var ii = 0; ii < templateElements.length; ii++) { 35 | var templateElement = templateElements[ii]; 36 | if (templateElement.value.raw !== '') { 37 | utils.append(getCookedValue(templateElement), state); 38 | if (!templateElement.tail) { 39 | // + between element and substitution 40 | utils.append(' + ', state); 41 | } 42 | // maintain line numbers 43 | utils.move(templateElement.range[0], state); 44 | utils.catchupNewlines(templateElement.range[1], state); 45 | } else { // templateElement.value.raw === '' 46 | // Concatenat adjacent substitutions, e.g. `${x}${y}`. Empty templates 47 | // appear before the first and after the last element - nothing to add in 48 | // those cases. 49 | if (ii > 0 && !templateElement.tail) { 50 | // + between substitution and substitution 51 | utils.append(' + ', state); 52 | } 53 | } 54 | 55 | utils.move(templateElement.range[1], state); 56 | if (!templateElement.tail) { 57 | var substitution = node.expressions[ii]; 58 | if (substitution.type === Syntax.Identifier || 59 | substitution.type === Syntax.MemberExpression || 60 | substitution.type === Syntax.CallExpression) { 61 | utils.catchup(substitution.range[1], state); 62 | } else { 63 | utils.append('(', state); 64 | traverse(substitution, path, state); 65 | utils.catchup(substitution.range[1], state); 66 | utils.append(')', state); 67 | } 68 | // if next templateElement isn't empty... 69 | if (templateElements[ii + 1].value.cooked !== '') { 70 | utils.append(' + ', state); 71 | } 72 | } 73 | } 74 | utils.move(node.range[1], state); 75 | utils.append(')', state); 76 | return false; 77 | } 78 | 79 | visitTemplateLiteral.test = function(node, path, state) { 80 | return node.type === Syntax.TemplateLiteral; 81 | }; 82 | 83 | /** 84 | * http://people.mozilla.org/~jorendorff/es6-draft.html#sec-12.2.6 85 | */ 86 | function visitTaggedTemplateExpression(traverse, node, path, state) { 87 | var template = node.quasi; 88 | var numQuasis = template.quasis.length; 89 | 90 | // print the tag 91 | utils.move(node.tag.range[0], state); 92 | traverse(node.tag, path, state); 93 | utils.catchup(node.tag.range[1], state); 94 | 95 | // print array of template elements 96 | utils.append('(function() { var siteObj = [', state); 97 | for (var ii = 0; ii < numQuasis; ii++) { 98 | utils.append(getCookedValue(template.quasis[ii]), state); 99 | if (ii !== numQuasis - 1) { 100 | utils.append(', ', state); 101 | } 102 | } 103 | utils.append(']; siteObj.raw = [', state); 104 | for (ii = 0; ii < numQuasis; ii++) { 105 | utils.append(getRawValue(template.quasis[ii]), state); 106 | if (ii !== numQuasis - 1) { 107 | utils.append(', ', state); 108 | } 109 | } 110 | utils.append( 111 | ']; Object.freeze(siteObj.raw); Object.freeze(siteObj); return siteObj; }()', 112 | state 113 | ); 114 | 115 | // print substitutions 116 | if (numQuasis > 1) { 117 | for (ii = 0; ii < template.expressions.length; ii++) { 118 | var expression = template.expressions[ii]; 119 | utils.append(', ', state); 120 | 121 | // maintain line numbers by calling catchupWhiteSpace over the whole 122 | // previous TemplateElement 123 | utils.move(template.quasis[ii].range[0], state); 124 | utils.catchupNewlines(template.quasis[ii].range[1], state); 125 | 126 | utils.move(expression.range[0], state); 127 | traverse(expression, path, state); 128 | utils.catchup(expression.range[1], state); 129 | } 130 | } 131 | 132 | // print blank lines to push the closing ) down to account for the final 133 | // TemplateElement. 134 | utils.catchupNewlines(node.range[1], state); 135 | 136 | utils.append(')', state); 137 | 138 | return false; 139 | } 140 | 141 | visitTaggedTemplateExpression.test = function(node, path, state) { 142 | return node.type === Syntax.TaggedTemplateExpression; 143 | }; 144 | 145 | function getCookedValue(templateElement) { 146 | return JSON.stringify(templateElement.value.cooked); 147 | } 148 | 149 | function getRawValue(templateElement) { 150 | return JSON.stringify(templateElement.value.raw); 151 | } 152 | 153 | exports.visitorList = [ 154 | visitTemplateLiteral, 155 | visitTaggedTemplateExpression 156 | ]; 157 | -------------------------------------------------------------------------------- /Support/node_modules/jstransform/node_modules/source-map/lib/source-map/base64-vlq.js: -------------------------------------------------------------------------------- 1 | /* -*- Mode: js; js-indent-level: 2; -*- */ 2 | /* 3 | * Copyright 2011 Mozilla Foundation and contributors 4 | * Licensed under the New BSD license. See LICENSE or: 5 | * http://opensource.org/licenses/BSD-3-Clause 6 | * 7 | * Based on the Base 64 VLQ implementation in Closure Compiler: 8 | * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java 9 | * 10 | * Copyright 2011 The Closure Compiler Authors. All rights reserved. 11 | * Redistribution and use in source and binary forms, with or without 12 | * modification, are permitted provided that the following conditions are 13 | * met: 14 | * 15 | * * Redistributions of source code must retain the above copyright 16 | * notice, this list of conditions and the following disclaimer. 17 | * * Redistributions in binary form must reproduce the above 18 | * copyright notice, this list of conditions and the following 19 | * disclaimer in the documentation and/or other materials provided 20 | * with the distribution. 21 | * * Neither the name of Google Inc. nor the names of its 22 | * contributors may be used to endorse or promote products derived 23 | * from this software without specific prior written permission. 24 | * 25 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 28 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 29 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 31 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 32 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 33 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 35 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 36 | */ 37 | if (typeof define !== 'function') { 38 | var define = require('amdefine')(module, require); 39 | } 40 | define(function (require, exports, module) { 41 | 42 | var base64 = require('./base64'); 43 | 44 | // A single base 64 digit can contain 6 bits of data. For the base 64 variable 45 | // length quantities we use in the source map spec, the first bit is the sign, 46 | // the next four bits are the actual value, and the 6th bit is the 47 | // continuation bit. The continuation bit tells us whether there are more 48 | // digits in this value following this digit. 49 | // 50 | // Continuation 51 | // | Sign 52 | // | | 53 | // V V 54 | // 101011 55 | 56 | var VLQ_BASE_SHIFT = 5; 57 | 58 | // binary: 100000 59 | var VLQ_BASE = 1 << VLQ_BASE_SHIFT; 60 | 61 | // binary: 011111 62 | var VLQ_BASE_MASK = VLQ_BASE - 1; 63 | 64 | // binary: 100000 65 | var VLQ_CONTINUATION_BIT = VLQ_BASE; 66 | 67 | /** 68 | * Converts from a two-complement value to a value where the sign bit is 69 | * is placed in the least significant bit. For example, as decimals: 70 | * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary) 71 | * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary) 72 | */ 73 | function toVLQSigned(aValue) { 74 | return aValue < 0 75 | ? ((-aValue) << 1) + 1 76 | : (aValue << 1) + 0; 77 | } 78 | 79 | /** 80 | * Converts to a two-complement value from a value where the sign bit is 81 | * is placed in the least significant bit. For example, as decimals: 82 | * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1 83 | * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2 84 | */ 85 | function fromVLQSigned(aValue) { 86 | var isNegative = (aValue & 1) === 1; 87 | var shifted = aValue >> 1; 88 | return isNegative 89 | ? -shifted 90 | : shifted; 91 | } 92 | 93 | /** 94 | * Returns the base 64 VLQ encoded value. 95 | */ 96 | exports.encode = function base64VLQ_encode(aValue) { 97 | var encoded = ""; 98 | var digit; 99 | 100 | var vlq = toVLQSigned(aValue); 101 | 102 | do { 103 | digit = vlq & VLQ_BASE_MASK; 104 | vlq >>>= VLQ_BASE_SHIFT; 105 | if (vlq > 0) { 106 | // There are still more digits in this value, so we must make sure the 107 | // continuation bit is marked. 108 | digit |= VLQ_CONTINUATION_BIT; 109 | } 110 | encoded += base64.encode(digit); 111 | } while (vlq > 0); 112 | 113 | return encoded; 114 | }; 115 | 116 | /** 117 | * Decodes the next base 64 VLQ value from the given string and returns the 118 | * value and the rest of the string. 119 | */ 120 | exports.decode = function base64VLQ_decode(aStr) { 121 | var i = 0; 122 | var strLen = aStr.length; 123 | var result = 0; 124 | var shift = 0; 125 | var continuation, digit; 126 | 127 | do { 128 | if (i >= strLen) { 129 | throw new Error("Expected more digits in base 64 VLQ value."); 130 | } 131 | digit = base64.decode(aStr.charAt(i++)); 132 | continuation = !!(digit & VLQ_CONTINUATION_BIT); 133 | digit &= VLQ_BASE_MASK; 134 | result = result + (digit << shift); 135 | shift += VLQ_BASE_SHIFT; 136 | } while (continuation); 137 | 138 | return { 139 | value: fromVLQSigned(result), 140 | rest: aStr.slice(i) 141 | }; 142 | }; 143 | 144 | }); 145 | -------------------------------------------------------------------------------- /info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | contactEmailRot13 6 | boyvivbhf@fhogyrtenqvrag.pbz 7 | contactName 8 | Thomas Aylott 9 | description 10 | 11 | mainMenu 12 | 13 | items 14 | 15 | 6298E048-4D1B-4DD2-A3F1-AB78DD181E06 16 | ------------------------------------ 17 | D551C035-3665-4E00-BFF5-801012A58876 18 | E54A7651-8834-4EF6-8852-468A24ACC6C6 19 | EA41CEBC-8AFB-4C46-B4F6-EAE56A97664A 20 | ------------------------------------ 21 | C8BDE80D-21C7-4237-886D-A099AC463665 22 | ------------------------------------ 23 | 158E1772-3408-4603-81DA-86FEF3FF018D 24 | 651DF907-70AB-40FF-BEB3-7F286675B160 25 | 26 | submenus 27 | 28 | 158E1772-3408-4603-81DA-86FEF3FF018D 29 | 30 | items 31 | 32 | A2A911D2-4D18-47CF-8E2D-FCDAD3006A1A 33 | FF421350-D5CD-4FB2-9FDE-D92B02CD7F73 34 | ------------------------------------ 35 | AB09302E-EE14-4464-92AB-240F0DD26596 36 | F9046994-D105-4D83-8E23-CFB535C892A7 37 | F1DF7529-7815-4FF8-918C-87BA71453EE3 38 | 39 | name 40 | Node.js 41 | 42 | 651DF907-70AB-40FF-BEB3-7F286675B160 43 | 44 | items 45 | 46 | EE871DA2-04F2-4499-8323-AB9004221C94 47 | DE5BE8AC-EDA3-4C1E-BDDE-FAD45F2D1B5C 48 | 49 | name 50 | Execute 51 | 52 | C8BDE80D-21C7-4237-886D-A099AC463665 53 | 54 | items 55 | 56 | 7C7E733F-D008-4A52-8A2C-7552836807C1 57 | 88D4CEE6-2D1F-4B65-A04D-F4ABBC8F9145 58 | 4108455E-925C-4009-B87F-4635199F6DE7 59 | ------------------------------------ 60 | 02917AD5-E190-40B5-998A-DD7DBC79BAF0 61 | ------------------------------------ 62 | F2A344A2-8546-41E8-BC60-EA331D4EF7B8 63 | EAC536BF-6C4C-4AE9-8437-B28E8EB31631 64 | 65 | name 66 | Validate 67 | 68 | D551C035-3665-4E00-BFF5-801012A58876 69 | 70 | items 71 | 72 | B4DDB005-470D-4D22-8FE8-B29FDC613A7A 73 | 67347C19-DA7A-41B8-8C48-8CC92E11E4E3 74 | 75 | name 76 | Convert 77 | 78 | E54A7651-8834-4EF6-8852-468A24ACC6C6 79 | 80 | items 81 | 82 | 9E7612FA-58B7-43AD-BCC4-F7989D953137 83 | E620A7EF-DB9B-48D9-874F-60EAF426E70D 84 | ------------------------------------ 85 | D3210BEC-4A3A-4FA9-8D7C-1A0F8065CFF5 86 | 0B51E320-D218-4352-8AEF-096B3232E818 87 | 16D885D1-78B1-47F2-9BCC-1F27B77B987E 88 | 2C4286B3-B2F3-4524-AE4B-3A2BB5CA1150 89 | 14281367-C8CB-4FE4-AD3B-E23B153F528D 90 | 91 | name 92 | Compress 93 | 94 | EA41CEBC-8AFB-4C46-B4F6-EAE56A97664A 95 | 96 | items 97 | 98 | 91A87FF2-F802-4999-98ED-4FEFC3465AC1 99 | 0C3CB37C-1C88-4F62-814B-5C6998E1709B 100 | 486A2267-2A7B-46B7-9C0A-BC81D33DC0CB 101 | 102 | name 103 | Reformat 104 | 105 | 106 | 107 | name 108 | JavaScript Tools 109 | ordering 110 | 111 | 6298E048-4D1B-4DD2-A3F1-AB78DD181E06 112 | A2A911D2-4D18-47CF-8E2D-FCDAD3006A1A 113 | EE871DA2-04F2-4499-8323-AB9004221C94 114 | DE5BE8AC-EDA3-4C1E-BDDE-FAD45F2D1B5C 115 | F9046994-D105-4D83-8E23-CFB535C892A7 116 | AB09302E-EE14-4464-92AB-240F0DD26596 117 | FF421350-D5CD-4FB2-9FDE-D92B02CD7F73 118 | F1DF7529-7815-4FF8-918C-87BA71453EE3 119 | 4108455E-925C-4009-B87F-4635199F6DE7 120 | 7C7E733F-D008-4A52-8A2C-7552836807C1 121 | EAC536BF-6C4C-4AE9-8437-B28E8EB31631 122 | 02917AD5-E190-40B5-998A-DD7DBC79BAF0 123 | 67347C19-DA7A-41B8-8C48-8CC92E11E4E3 124 | E620A7EF-DB9B-48D9-874F-60EAF426E70D 125 | D3210BEC-4A3A-4FA9-8D7C-1A0F8065CFF5 126 | 0B51E320-D218-4352-8AEF-096B3232E818 127 | 0C3CB37C-1C88-4F62-814B-5C6998E1709B 128 | 91A87FF2-F802-4999-98ED-4FEFC3465AC1 129 | 16D885D1-78B1-47F2-9BCC-1F27B77B987E 130 | 2C4286B3-B2F3-4524-AE4B-3A2BB5CA1150 131 | 9E7612FA-58B7-43AD-BCC4-F7989D953137 132 | 88D4CEE6-2D1F-4B65-A04D-F4ABBC8F9145 133 | 14281367-C8CB-4FE4-AD3B-E23B153F528D 134 | F2A344A2-8546-41E8-BC60-EA331D4EF7B8 135 | B4DDB005-470D-4D22-8FE8-B29FDC613A7A 136 | 486A2267-2A7B-46B7-9C0A-BC81D33DC0CB 137 | 138 | uuid 139 | 3A0A9B86-5306-421D-A662-F308C2E09D2E 140 | 141 | 142 | --------------------------------------------------------------------------------