Merge pull request +15085 from c9/ide-sdk-prs

Merge  sdk prs
pull/385/head
Harutyun Amirjanyan 2016-11-29 04:48:44 +04:00 zatwierdzone przez GitHub
commit 163fd83b2d
4 zmienionych plików z 30 dodań i 16 usunięć

Wyświetl plik

@ -47,7 +47,7 @@ Semicolons
There are [rebellious forces][isaac] that try to steal your semicolons from you. But make no mistake, our traditional culture is still [well and truly alive][hnsemicolons]. So follow the community, and use those semicolons!
[isaac]: community.html#isaac-schlueter
[isaac]: http://nodeguide.com/community.html#isaac-schlueter
[hnsemicolons]: http://news.ycombinator.com/item?id=1547647
Trailing whitespace
@ -130,7 +130,7 @@ If the block inside the curlys consists only of one statement the curlys may be
return callback(err);
```
However within one condition curlys must be used consistently.
However, curlys must be used consistently throughout the statement.
*Right:*
@ -144,6 +144,15 @@ However within one condition curlys must be used consistently.
}
```
*Right:*
```javascript
if (true)
console.log("Yes");
else
console.log("Oh noo");
```
*Wrong:*
```javascript
@ -256,7 +265,7 @@ Constants
Constants should be declared as regular variables or static class properties, using all uppercase letters.
Node.js / V8 actually supports mozilla's [const][const] extension, but unfortunately that cannot be applied to class members, nor is it part of any ECMA standard.
Node.js / V8 actually supports Mozilla's [const][const] extension, but unfortunately that cannot be applied to class members, nor is it part of any ECMA standard.
*Right:*
@ -655,7 +664,7 @@ NOTE: It is sometimes useful to write a case statement which falls through to th
Vertical alignment
------------------
Vertically aligning asignments can improve readability but also makes it harder to maintain the code. The style should be avoided.
Vertically aligning assignments can improve readability but also makes it harder to maintain the code. The style should be avoided.
*Right*:

Wyświetl plik

@ -70,13 +70,13 @@
"c9.ide.language.javascript.tern": "#4d53f32c29",
"c9.ide.language.javascript.infer": "#b9c2e4bdb8",
"c9.ide.language.jsonalyzer": "#a0549e14ff",
"c9.ide.language.codeintel": "#7de0cedca6",
"c9.ide.language.codeintel": "#957b840fff",
"c9.ide.collab": "#d77a9618ea",
"c9.ide.local": "#9169fec157",
"c9.ide.find": "#e632ecf4be",
"c9.ide.find.infiles": "#ad9ff74638",
"c9.ide.find.replace": "#8468067976",
"c9.ide.run.debug": "#8963fb45c4",
"c9.ide.run.debug": "#dab860c046",
"c9.automate": "#47e2c429c9",
"c9.ide.ace.emmet": "#6dc4585e02",
"c9.ide.ace.gotoline": "#d33220b1e0",
@ -95,7 +95,7 @@
"c9.ide.imgeditor": "#612e75ef4f",
"c9.ide.immediate": "#0b0ee744f9",
"c9.ide.installer": "#2921efaf6d",
"c9.ide.language.python": "#e1b6ce0937",
"c9.ide.language.python": "#189b55135d",
"c9.ide.language.go": "#c58539fc05",
"c9.ide.navigate": "#5d5707058c",
"c9.ide.newresource": "#981a408a7b",

Wyświetl plik

@ -115,7 +115,7 @@ function plugin(options, imports, register) {
var accept = req.headers.accept || '';
if (statusCode == 500) {
console.error(err && err.stack);
console.error(err && (err.stack || err));
emitter.emit("internalServerError", {
err: err,
req: req

Wyświetl plik

@ -1461,11 +1461,16 @@ define(function(require, exports, module) {
return;
}
else if (/^#!/.test(firstLine)) {
var match = firstLine.match(/\b(node|bash|sh)\b/);
switch (match && match[1]) {
var match = firstLine.match(/\b(bash|ksh|node|perl|sh)\b|\b(php|python|ruby)/);
switch (match && (match[1] || match[2])) {
case "bash": // fallthrough
case "ksh":
case "sh": syntax = "sh"; break;
case "node": syntax = "javascript"; break;
case "sh": // fallthrough
case "bash": syntax = "sh"; break;
case "perl": syntax = "perl"; break;
case "php": syntax = "php"; break;
case "python": syntax = "python"; break;
case "ruby": syntax = "ruby"; break;
default: syntax = ""; break;
}
}