Skip to content

Commit

Permalink
2016-08-27 [ci skip] Version: 1.201608270006.1+e62f1181b6a94161f8bfa8…
Browse files Browse the repository at this point in the history
…8a84c2cf4c0f66bc3a
  • Loading branch information
basarat committed Aug 27, 2016
1 parent 9ec404d commit 42ded84
Show file tree
Hide file tree
Showing 9 changed files with 42 additions and 15 deletions.
17 changes: 13 additions & 4 deletions bin/ntypescript.js
Original file line number Diff line number Diff line change
Expand Up @@ -10251,6 +10251,7 @@ var ts;
token() === 25 /* LessThanToken */ ||
token() === 53 /* QuestionToken */ ||
token() === 54 /* ColonToken */ ||
token() === 24 /* CommaToken */ ||
canParseSemicolon();
}
return false;
Expand Down Expand Up @@ -33492,7 +33493,13 @@ var ts;
(augmentations || (augmentations = [])).push(file.moduleAugmentations);
}
if (file.symbol && file.symbol.globalExports) {
mergeSymbolTable(globals, file.symbol.globalExports);
// Merge in UMD exports with first-in-wins semantics (see #9771)
var source = file.symbol.globalExports;
for (var id in source) {
if (!(id in globals)) {
globals[id] = source[id];
}
}
}
});
if (augmentations) {
Expand Down Expand Up @@ -36799,8 +36806,10 @@ var ts;
// it if it's not a well known symbol. In that case, the text of the name will be exactly
// what we want, namely the name expression enclosed in brackets.
writeTextOfNode(currentText, node.name);
// If optional property emit ?
if ((node.kind === 145 /* PropertyDeclaration */ || node.kind === 144 /* PropertySignature */ || node.kind === 142 /* Parameter */) && ts.hasQuestionToken(node)) {
// If optional property emit ? but in the case of parameterProperty declaration with "?" indicating optional parameter for the constructor
// we don't want to emit property declaration with "?"
if ((node.kind === 145 /* PropertyDeclaration */ || node.kind === 144 /* PropertySignature */ ||
(node.kind === 142 /* Parameter */ && !ts.isParameterPropertyDeclaration(node))) && ts.hasQuestionToken(node)) {
write("?");
}
if ((node.kind === 145 /* PropertyDeclaration */ || node.kind === 144 /* PropertySignature */) && node.parent.kind === 159 /* TypeLiteral */) {
Expand Down Expand Up @@ -43495,7 +43504,7 @@ var ts;
// import { x, y } from "foo"
// import d, * as x from "foo"
// import d, { x, y } from "foo"
var isNakedImport = 230 /* ImportDeclaration */ && !node.importClause;
var isNakedImport = node.kind === 230 /* ImportDeclaration */ && !node.importClause;
if (!isNakedImport) {
write(varOrConst);
write(getGeneratedNameForNode(node));
Expand Down
17 changes: 13 additions & 4 deletions bin/typescript.js
Original file line number Diff line number Diff line change
Expand Up @@ -10251,6 +10251,7 @@ var ts;
token() === 25 /* LessThanToken */ ||
token() === 53 /* QuestionToken */ ||
token() === 54 /* ColonToken */ ||
token() === 24 /* CommaToken */ ||
canParseSemicolon();
}
return false;
Expand Down Expand Up @@ -33492,7 +33493,13 @@ var ts;
(augmentations || (augmentations = [])).push(file.moduleAugmentations);
}
if (file.symbol && file.symbol.globalExports) {
mergeSymbolTable(globals, file.symbol.globalExports);
// Merge in UMD exports with first-in-wins semantics (see #9771)
var source = file.symbol.globalExports;
for (var id in source) {
if (!(id in globals)) {
globals[id] = source[id];
}
}
}
});
if (augmentations) {
Expand Down Expand Up @@ -36799,8 +36806,10 @@ var ts;
// it if it's not a well known symbol. In that case, the text of the name will be exactly
// what we want, namely the name expression enclosed in brackets.
writeTextOfNode(currentText, node.name);
// If optional property emit ?
if ((node.kind === 145 /* PropertyDeclaration */ || node.kind === 144 /* PropertySignature */ || node.kind === 142 /* Parameter */) && ts.hasQuestionToken(node)) {
// If optional property emit ? but in the case of parameterProperty declaration with "?" indicating optional parameter for the constructor
// we don't want to emit property declaration with "?"
if ((node.kind === 145 /* PropertyDeclaration */ || node.kind === 144 /* PropertySignature */ ||
(node.kind === 142 /* Parameter */ && !ts.isParameterPropertyDeclaration(node))) && ts.hasQuestionToken(node)) {
write("?");
}
if ((node.kind === 145 /* PropertyDeclaration */ || node.kind === 144 /* PropertySignature */) && node.parent.kind === 159 /* TypeLiteral */) {
Expand Down Expand Up @@ -43495,7 +43504,7 @@ var ts;
// import { x, y } from "foo"
// import d, * as x from "foo"
// import d, { x, y } from "foo"
var isNakedImport = 230 /* ImportDeclaration */ && !node.importClause;
var isNakedImport = node.kind === 230 /* ImportDeclaration */ && !node.importClause;
if (!isNakedImport) {
write(varOrConst);
write(getGeneratedNameForNode(node));
Expand Down
2 changes: 1 addition & 1 deletion kicktravis
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2016-08-26 [ci skip] Version: 1.201608260007.1+0041d5ce7907f9ee974693ace54efd64afa1971a
2016-08-27 [ci skip] Version: 1.201608270006.1+e62f1181b6a94161f8bfa88a84c2cf4c0f66bc3a
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ntypescript",
"version": "1.201608260007.1+0041d5ce7907f9ee974693ace54efd64afa1971a",
"version": "1.201608270006.1+e62f1181b6a94161f8bfa88a84c2cf4c0f66bc3a",
"description": "A nicer version of microsoft/typescript packaged and released for API developers",
"main": "./bin/ntypescript.js",
"bin": {
Expand Down
8 changes: 7 additions & 1 deletion src/compiler/checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18763,7 +18763,13 @@ namespace ts {
(augmentations || (augmentations = [])).push(file.moduleAugmentations);
}
if (file.symbol && file.symbol.globalExports) {
mergeSymbolTable(globals, file.symbol.globalExports);
// Merge in UMD exports with first-in-wins semantics (see #9771)
const source = file.symbol.globalExports;
for (const id in source) {
if (!(id in globals)) {
globals[id] = source[id];
}
}
}
});

Expand Down
6 changes: 4 additions & 2 deletions src/compiler/declarationEmitter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1132,8 +1132,10 @@ namespace ts {
// it if it's not a well known symbol. In that case, the text of the name will be exactly
// what we want, namely the name expression enclosed in brackets.
writeTextOfNode(currentText, node.name);
// If optional property emit ?
if ((node.kind === SyntaxKind.PropertyDeclaration || node.kind === SyntaxKind.PropertySignature || node.kind === SyntaxKind.Parameter) && hasQuestionToken(node)) {
// If optional property emit ? but in the case of parameterProperty declaration with "?" indicating optional parameter for the constructor
// we don't want to emit property declaration with "?"
if ((node.kind === SyntaxKind.PropertyDeclaration || node.kind === SyntaxKind.PropertySignature ||
(node.kind === SyntaxKind.Parameter && !isParameterPropertyDeclaration(node))) && hasQuestionToken(node)) {
write("?");
}
if ((node.kind === SyntaxKind.PropertyDeclaration || node.kind === SyntaxKind.PropertySignature) && node.parent.kind === SyntaxKind.TypeLiteral) {
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/emitter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6587,7 +6587,7 @@ const _super = (function (geti, seti) {
// import { x, y } from "foo"
// import d, * as x from "foo"
// import d, { x, y } from "foo"
const isNakedImport = SyntaxKind.ImportDeclaration && !(<ImportDeclaration>node).importClause;
const isNakedImport = node.kind === SyntaxKind.ImportDeclaration && !(<ImportDeclaration>node).importClause;
if (!isNakedImport) {
write(varOrConst);
write(getGeneratedNameForNode(<ImportDeclaration>node));
Expand Down
1 change: 1 addition & 0 deletions src/compiler/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2339,6 +2339,7 @@ namespace ts {
token() === SyntaxKind.LessThanToken ||
token() === SyntaxKind.QuestionToken ||
token() === SyntaxKind.ColonToken ||
token() === SyntaxKind.CommaToken ||
canParseSemicolon();
}
return false;
Expand Down

0 comments on commit 42ded84

Please sign in to comment.