Merge remote-tracking branch 'origin/master' into graceful-vfs-deploy

This commit is contained in:
Tim Robinson 2015-07-16 11:59:20 +00:00
commit b1ede4860e
15 changed files with 7070 additions and 3816 deletions

3255
node_modules/treehugger/lib/acorn/dist/acorn.js generated vendored Normal file

File diff suppressed because it is too large Load Diff

1306
node_modules/treehugger/lib/acorn/dist/acorn_loose.js generated vendored Normal file

File diff suppressed because it is too large Load Diff

378
node_modules/treehugger/lib/acorn/dist/walk.js generated vendored Normal file
View File

@ -0,0 +1,378 @@
define(["require", "exports", "module", "./acorn"], function(require, exports, module) {
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}(g.acorn || (g.acorn = {})).walk = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({"/src\\walk\\index.js":[function(_dereq_,module,exports){
"use strict";
var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } };
// AST walker module for Mozilla Parser API compatible trees
// A simple walk is one where you simply specify callbacks to be
// called on specific nodes. The last two arguments are optional. A
// simple use would be
//
// walk.simple(myTree, {
// Expression: function(node) { ... }
// });
//
// to do something with all expressions. All Parser API node types
// can be used to identify node types, as well as Expression,
// Statement, and ScopeBody, which denote categories of nodes.
//
// The base argument can be used to pass a custom (recursive)
// walker, and state can be used to give this walked an initial
// state.
exports.simple = simple;
// An ancestor walk builds up an array of ancestor nodes (including
// the current node) and passes them to the callback as the state parameter.
exports.ancestor = ancestor;
// A recursive walk is one where your functions override the default
// walkers. They can modify and replace the state parameter that's
// threaded through the walk, and can opt how and whether to walk
// their child nodes (by calling their third argument on these
// nodes).
exports.recursive = recursive;
// Find a node with a given start, end, and type (all are optional,
// null can be used as wildcard). Returns a {node, state} object, or
// undefined when it doesn't find a matching node.
exports.findNodeAt = findNodeAt;
// Find the innermost node of a given type that contains the given
// position. Interface similar to findNodeAt.
exports.findNodeAround = findNodeAround;
// Find the outermost matching node after a given position.
exports.findNodeAfter = findNodeAfter;
// Find the outermost matching node before a given position.
exports.findNodeBefore = findNodeBefore;
// Used to create a custom walker. Will fill in all missing node
// type properties with the defaults.
exports.make = make;
exports.__esModule = true;
function simple(node, visitors, base, state, override) {
if (!base) base = exports.base;(function c(node, st, override) {
var type = override || node.type,
found = visitors[type];
base[type](node, st, c);
if (found) found(node, st);
})(node, state, override);
}
function ancestor(node, visitors, base, state) {
if (!base) base = exports.base;
if (!state) state = [];(function c(node, st, override) {
var type = override || node.type,
found = visitors[type];
if (node != st[st.length - 1]) {
st = st.slice();
st.push(node);
}
base[type](node, st, c);
if (found) found(node, st);
})(node, state);
}
function recursive(node, state, funcs, base, override) {
var visitor = funcs ? exports.make(funcs, base) : base;(function c(node, st, override) {
visitor[override || node.type](node, st, c);
})(node, state, override);
}
function makeTest(test) {
if (typeof test == "string") {
return function (type) {
return type == test;
};
} else if (!test) {
return function () {
return true;
};
} else {
return test;
}
}
var Found = function Found(node, state) {
_classCallCheck(this, Found);
this.node = node;this.state = state;
};
function findNodeAt(node, start, end, test, base, state) {
test = makeTest(test);
if (!base) base = exports.base;
try {
;(function c(node, st, override) {
var type = override || node.type;
if ((start == null || node.start <= start) && (end == null || node.end >= end)) base[type](node, st, c);
if (test(type, node) && (start == null || node.start == start) && (end == null || node.end == end)) throw new Found(node, st);
})(node, state);
} catch (e) {
if (e instanceof Found) {
return e;
}throw e;
}
}
function findNodeAround(node, pos, test, base, state) {
test = makeTest(test);
if (!base) base = exports.base;
try {
;(function c(node, st, override) {
var type = override || node.type;
if (node.start > pos || node.end < pos) {
return;
}base[type](node, st, c);
if (test(type, node)) throw new Found(node, st);
})(node, state);
} catch (e) {
if (e instanceof Found) {
return e;
}throw e;
}
}
function findNodeAfter(node, pos, test, base, state) {
test = makeTest(test);
if (!base) base = exports.base;
try {
;(function c(node, st, override) {
if (node.end < pos) {
return;
}var type = override || node.type;
if (node.start >= pos && test(type, node)) throw new Found(node, st);
base[type](node, st, c);
})(node, state);
} catch (e) {
if (e instanceof Found) {
return e;
}throw e;
}
}
function findNodeBefore(node, pos, test, base, state) {
test = makeTest(test);
if (!base) base = exports.base;
var max = undefined;(function c(node, st, override) {
if (node.start > pos) {
return;
}var type = override || node.type;
if (node.end <= pos && (!max || max.node.end < node.end) && test(type, node)) max = new Found(node, st);
base[type](node, st, c);
})(node, state);
return max;
}
function make(funcs, base) {
if (!base) base = exports.base;
var visitor = {};
for (var type in base) visitor[type] = base[type];
for (var type in funcs) visitor[type] = funcs[type];
return visitor;
}
function skipThrough(node, st, c) {
c(node, st);
}
function ignore(_node, _st, _c) {}
// Node walkers.
var base = {};
exports.base = base;
base.Program = base.BlockStatement = function (node, st, c) {
for (var i = 0; i < node.body.length; ++i) {
c(node.body[i], st, "Statement");
}
};
base.Statement = skipThrough;
base.EmptyStatement = ignore;
base.ExpressionStatement = base.ParenthesizedExpression = function (node, st, c) {
return c(node.expression, st, "Expression");
};
base.IfStatement = function (node, st, c) {
c(node.test, st, "Expression");
c(node.consequent, st, "Statement");
if (node.alternate) c(node.alternate, st, "Statement");
};
base.LabeledStatement = function (node, st, c) {
return c(node.body, st, "Statement");
};
base.BreakStatement = base.ContinueStatement = ignore;
base.WithStatement = function (node, st, c) {
c(node.object, st, "Expression");
c(node.body, st, "Statement");
};
base.SwitchStatement = function (node, st, c) {
c(node.discriminant, st, "Expression");
for (var i = 0; i < node.cases.length; ++i) {
var cs = node.cases[i];
if (cs.test) c(cs.test, st, "Expression");
for (var j = 0; j < cs.consequent.length; ++j) {
c(cs.consequent[j], st, "Statement");
}
}
};
base.ReturnStatement = base.YieldExpression = function (node, st, c) {
if (node.argument) c(node.argument, st, "Expression");
};
base.ThrowStatement = base.SpreadElement = function (node, st, c) {
return c(node.argument, st, "Expression");
};
base.TryStatement = function (node, st, c) {
c(node.block, st, "Statement");
if (node.handler) {
c(node.handler.param, st, "Pattern");
c(node.handler.body, st, "ScopeBody");
}
if (node.finalizer) c(node.finalizer, st, "Statement");
};
base.WhileStatement = base.DoWhileStatement = function (node, st, c) {
c(node.test, st, "Expression");
c(node.body, st, "Statement");
};
base.ForStatement = function (node, st, c) {
if (node.init) c(node.init, st, "ForInit");
if (node.test) c(node.test, st, "Expression");
if (node.update) c(node.update, st, "Expression");
c(node.body, st, "Statement");
};
base.ForInStatement = base.ForOfStatement = function (node, st, c) {
c(node.left, st, "ForInit");
c(node.right, st, "Expression");
c(node.body, st, "Statement");
};
base.ForInit = function (node, st, c) {
if (node.type == "VariableDeclaration") c(node, st);else c(node, st, "Expression");
};
base.DebuggerStatement = ignore;
base.FunctionDeclaration = function (node, st, c) {
return c(node, st, "Function");
};
base.VariableDeclaration = function (node, st, c) {
for (var i = 0; i < node.declarations.length; ++i) {
var decl = node.declarations[i];
c(decl.id, st, "Pattern");
if (decl.init) c(decl.init, st, "Expression");
}
};
base.Function = function (node, st, c) {
for (var i = 0; i < node.params.length; i++) {
c(node.params[i], st, "Pattern");
}c(node.body, st, "ScopeBody");
};
base.ScopeBody = function (node, st, c) {
return c(node, st, "Statement");
};
base.Pattern = function (node, st, c) {
if (node.type == "Identifier") c(node, st, "VariablePattern");else if (node.type == "MemberExpression") c(node, st, "MemberPattern");else c(node, st);
};
base.VariablePattern = ignore;
base.MemberPattern = skipThrough;
base.RestElement = function (node, st, c) {
return c(node.argument, st, "Pattern");
};
base.ArrayPattern = function (node, st, c) {
for (var i = 0; i < node.elements.length; ++i) {
var elt = node.elements[i];
if (elt) c(elt, st, "Pattern");
}
};
base.ObjectPattern = function (node, st, c) {
for (var i = 0; i < node.properties.length; ++i) {
c(node.properties[i].value, st, "Pattern");
}
};
base.Expression = skipThrough;
base.ThisExpression = base.Super = base.MetaProperty = ignore;
base.ArrayExpression = function (node, st, c) {
for (var i = 0; i < node.elements.length; ++i) {
var elt = node.elements[i];
if (elt) c(elt, st, "Expression");
}
};
base.ObjectExpression = function (node, st, c) {
for (var i = 0; i < node.properties.length; ++i) {
c(node.properties[i], st);
}
};
base.FunctionExpression = base.ArrowFunctionExpression = base.FunctionDeclaration;
base.SequenceExpression = base.TemplateLiteral = function (node, st, c) {
for (var i = 0; i < node.expressions.length; ++i) {
c(node.expressions[i], st, "Expression");
}
};
base.UnaryExpression = base.UpdateExpression = function (node, st, c) {
c(node.argument, st, "Expression");
};
base.BinaryExpression = base.LogicalExpression = function (node, st, c) {
c(node.left, st, "Expression");
c(node.right, st, "Expression");
};
base.AssignmentExpression = base.AssignmentPattern = function (node, st, c) {
c(node.left, st, "Pattern");
c(node.right, st, "Expression");
};
base.ConditionalExpression = function (node, st, c) {
c(node.test, st, "Expression");
c(node.consequent, st, "Expression");
c(node.alternate, st, "Expression");
};
base.NewExpression = base.CallExpression = function (node, st, c) {
c(node.callee, st, "Expression");
if (node.arguments) for (var i = 0; i < node.arguments.length; ++i) {
c(node.arguments[i], st, "Expression");
}
};
base.MemberExpression = function (node, st, c) {
c(node.object, st, "Expression");
if (node.computed) c(node.property, st, "Expression");
};
base.ExportNamedDeclaration = base.ExportDefaultDeclaration = function (node, st, c) {
if (node.declaration) c(node.declaration, st);
};
base.ImportDeclaration = function (node, st, c) {
for (var i = 0; i < node.specifiers.length; i++) {
c(node.specifiers[i], st);
}
};
base.ImportSpecifier = base.ImportDefaultSpecifier = base.ImportNamespaceSpecifier = base.Identifier = base.Literal = ignore;
base.TaggedTemplateExpression = function (node, st, c) {
c(node.tag, st, "Expression");
c(node.quasi, st);
};
base.ClassDeclaration = base.ClassExpression = function (node, st, c) {
return c(node, st, "Class");
};
base.Class = function (node, st, c) {
if (node.id) c(node.id, st, "Pattern");
if (node.superClass) c(node.superClass, st, "Expression");
for (var i = 0; i < node.body.body.length; i++) {
c(node.body.body[i], st);
}
};
base.MethodDefinition = base.Property = function (node, st, c) {
if (node.computed) c(node.key, st, "Expression");
c(node.value, st, "Expression");
};
base.ComprehensionExpression = function (node, st, c) {
for (var i = 0; i < node.blocks.length; i++) {
c(node.blocks[i].right, st, "Expression");
}c(node.body, st, "Expression");
};
},{}]},{},["/src\\walk\\index.js"])("/src\\walk\\index.js")
});
});

12
node_modules/treehugger/lib/demo.js generated vendored
View File

@ -1,7 +1,7 @@
require({
baseUrl: "lib"
}, ["treehugger/tree", "treehugger/traverse", "treehugger/js/parse", "jquery",
"treehugger/js/acorn", "treehugger/js/acorn_loose"
"acorn/dist/acorn", "acorn/dist/acorn_loose", "acorn/dist/walk"
], function(tree, traverse, parsejs, jq, acorn, acorn_loose) {
window.acorn_loose = acorn_loose
@ -30,9 +30,9 @@ window.acorn_loose = acorn_loose
$("#output").val(this.toPrettyString());
}
require.ready(function() {
$("#code").keyup(exec);
$("#runbutton").click(exec);
exec();
});
$("#code").keyup(exec);
$("#runbutton").click(exec);
exec();
});

2114
node_modules/treehugger/lib/require.js generated vendored

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
define(function(require, exports, module) {
var parser = require("treehugger/js/acorn_loose");
var parser = require("acorn/dist/acorn_loose");
var tree = require('treehugger/tree');
// var REV = 0; // for debugging
@ -195,20 +195,19 @@ exports.transform = function transform(n) {
resultNode = tree.cons("With", [transform(n.object), tree.list((n.body.body||[]).map(transform))]);
break;
case "Literal":
switch (n.kind) {
case "num":
resultNode = tree.cons("Num", [id(n, n.raw)]);
break;
case "string":
resultNode = tree.cons("String", [id(n, n.value)]);
break;
case "regexp":
var val = n.raw, i = val.lastIndexOf("/");
var litType = typeof n.value;
if (litType == "number") {
resultNode = tree.cons("Num", [id(n, n.raw)]);
} else if (litType == "string") {
resultNode = tree.cons("String", [id(n, n.value)]);
} else {
var val = n.raw;
if (val[0] == "/") {
var i = val.lastIndexOf("/");
resultNode = tree.cons("RegExp", [tree.string(val.slice(1, i)), tree.string(val.substr(i + 1))]);
break;
default:
} else {
resultNode = tree.cons("Var", [tree.string(n.value + "")]);
break;
}
}
break;
case "ERROR":
@ -278,7 +277,6 @@ exports.transform = function transform(n) {
});
}*/
resultNode.$pos = n.loc;
// resultNode.REV = resultNode.annos.REV = REV;
return resultNode;
};
});

View File

@ -99,8 +99,7 @@ module.exports = {
assert.equal(parser.parse("if(").toString(), '[If(Var("✖"),Block([]),None())]');
// todo should this be broken if and a function outside?
assert.equal(parser.parse("if(hello.\nfunction hello() { return 0; }").toString(), '[If(PropAccess(Var("hello"),"✖"),Function("hello",[],[Return(Num("0"))]),None())]');
// lame, recovery regression
// assert.equal(parser.parse("var\nfunction hello() {}").toString(), '[VarDecls([VarDecl("✖")]),Function("hello",[],[])]');
assert.equal(parser.parse("var\nfunction hello() {}").toString(), '[VarDecls([]),Function("hello",[],[])]');
},
"test parse literals": function() {
assert.equal(parser.parse("true").toString(), '[Var("true")]');

View File

@ -33,7 +33,7 @@
"rusha": "~0.7.2",
"send": "~0.1.4",
"simple-mime": "~0.0.8",
"tern": "git://github.com/lennartcl/tern.git#97464df789dbb4d81ca4579383a02b320c69563d",
"tern": "git://github.com/cloud9ide/tern.git#42164cde34b4cb057fa0c53d3881a58d903a3135",
"tern_from_ts": "git://github.com/cloud9ide/tern_from_ts.git#6a0107e602b0d044fe1753533cf31f52cf5fb95a",
"through": "2.2.0",
"tmp": "~0.0.20",
@ -56,7 +56,7 @@
"c9"
],
"c9plugins": {
"c9.ide.language": "#f762c3f34d",
"c9.ide.language": "#7239694abb",
"c9.ide.language.css": "#ef8a28943e",
"c9.ide.language.generic": "#7505e7902e",
"c9.ide.language.html": "#bbe81afed1",
@ -64,7 +64,7 @@
"c9.ide.language.javascript": "#8479d0a9c1",
"c9.ide.language.javascript.immediate": "#0535804ada",
"c9.ide.language.javascript.eslint": "#2db744b1a3",
"c9.ide.language.javascript.tern": "#2b0bb024da",
"c9.ide.language.javascript.tern": "#504150a52f",
"c9.ide.language.javascript.infer": "#cfec494a3c",
"c9.ide.language.jsonalyzer": "#ba3e0d298c",
"c9.ide.collab": "#134f6b68a8",
@ -90,7 +90,7 @@
"c9.ide.help.support": "#26d754dcff",
"c9.ide.imgeditor": "#66a9733dc1",
"c9.ide.immediate": "#6845a93705",
"c9.ide.installer": "#c36540bd61",
"c9.ide.installer": "#be8d9aa07c",
"c9.ide.mount": "#f89d3f7570",
"c9.ide.navigate": "#f358997d93",
"c9.ide.newresource": "#f1f0624768",

View File

@ -291,12 +291,21 @@ define(function(require, exports, module) {
prepareDirectory(function(err, packagePath){
if (err) return callback(err);
var npmBin = [
join(process.env.HOME, process.platform == "win32"? ".c9/npm.cmd" : ".c9/node/bin/npm"),
"/mnt/shared/sbin/npm"
];
function installNPM(){
spawn(join(process.env.HOME, process.platform == "win32"? ".c9/npm.cmd" : ".c9/node/bin/npm"), {
spawn(npmBin[0], {
args: ["install"],
cwd: packagePath
}, function(err) {
if (err && err.code == 127) {
npmBin.shift();
if (npmBin.length)
return installNPM();
}
if (err) return callback(err);
callback(null, { version: version });
});

View File

@ -33,7 +33,7 @@ define(function(require, exports, module) {
ace: "lib/ace/lib/ace",
ace_tree: "lib/ace_tree/lib/ace_tree",
treehugger: "lib/treehugger/lib/treehugger",
acorn: "lib/treehugger/lib/treehugger/js",
acorn: "lib/treehugger/lib/acorn",
tern: "lib/tern",
tern_from_ts: "lib/tern_from_ts",
ui: "lib/ui",

View File

@ -409,7 +409,7 @@ document.addEventListener("keydown", function(e) {
var hashId = 0 | (e.ctrlKey ? 1 : 0) | (e.altKey ? 2 : 0)
| (e.shiftKey ? 4 : 0) | (e.metaKey ? 8 : 0);
var keys = ckb[hashId];
var keys = ckb && ckb[hashId];
var cmd = keys && keys[e.keyCode];
if (cmd) {

View File

@ -161,5 +161,7 @@ installGlobalDeps
updateAllPackages
updateNodeModules
echo -e "c9.*\n.gitignore" > plugins/.gitignore
echo "Success!"
echo "run '${yellow}node server.js -p 8181 -l 0.0.0.0 -a :${resetColor}' to launch Cloud9"

View File

@ -2,19 +2,25 @@ var modules = require("module");
var oldResolve = modules._resolveFilename;
var extraPaths = [
__dirname + "/../node_modules/ace/lib",
__dirname + "/../node_modules/treehugger/lib",
__dirname + "/../node_modules/v8debug/lib",
__dirname + "/../"
];
modules._resolveFilename = function(request, paths) {
var extraPathOverrides = [
__dirname + "/../node_modules/treehugger/lib",
];
modules._resolveFilename = function(request, parent) {
// Ensure client extensions can be loaded
request = request.replace(/^ext\//, "ext.")
.replace(/^core\//, "cloud9.core/www/core/")
.replace(/^lib\/chai\//, "chai/");
// Add the extra paths
extraPaths.forEach(function(p) {
if(paths.paths.indexOf(p) === -1)
paths.paths.push(p);
if (parent.paths.indexOf(p) === -1)
parent.paths.push(p);
});
return oldResolve(request, paths);
extraPathOverrides.forEach(function(p) {
if (parent.paths.indexOf(p) === -1)
parent.paths.unshift(p);
});
return oldResolve(request, parent);
};