Skip to content

Commit

Permalink
Upgrade to TypeScript 1.7.3
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffrey-easyesi committed Nov 21, 2015
1 parent 57628a5 commit ede8113
Show file tree
Hide file tree
Showing 23 changed files with 2,574 additions and 1,482 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Download the latest netbeanstypescript.nbm file from the [Releases](https://gith

### Versioning

The version number of this plugin reflects the version of TypeScript it incorporates (currently 1.6.2), with an extra digit for new versions that do not involve a TypeScript update. We intend to keep this plugin up to date with new versions of TypeScript when they come out.
The version number of this plugin reflects the version of TypeScript it incorporates (currently 1.7.3), with an extra digit for new versions that do not involve a TypeScript update. We intend to keep this plugin up to date with new versions of TypeScript when they come out.

### Contributing

Expand All @@ -33,5 +33,5 @@ We are happy to receive Pull Requests. If you are planning a big change, it's pr

To build the plugin yourself, there are a couple of things that must be done first:
* Edit this line in `build.xml` to point to where you have TypeScript installed:
`<property name="typescript" value="${env.HOME}/TypeScript-1.6.2"/>`
`<property name="typescript" value="${env.HOME}/TypeScript-1.7.3"/>`
* Open the project in NetBeans. (You can either build in NetBeans or run `ant` from the command line, but either way you must open the project first to create the `nbproject/private` files.)
2 changes: 1 addition & 1 deletion build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<import file="nbproject/build-impl.xml"/>

<property environment="env"/>
<property name="typescript" value="${env.HOME}/TypeScript-1.6.2"/>
<property name="typescript" value="${env.HOME}/TypeScript-1.7.3"/>

<target name="compile" depends="projectized-common.compile">
<copy file="${typescript}/lib/lib.d.ts" todir="${build.classes.dir}/netbeanstypescript/resources/"/>
Expand Down
2 changes: 1 addition & 1 deletion manifest.mf
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ AutoUpdate-Show-In-Client: true
OpenIDE-Module: netbeanstypescript
OpenIDE-Module-Layer: netbeanstypescript/resources/layer.xml
OpenIDE-Module-Localizing-Bundle: netbeanstypescript/Bundle.properties
OpenIDE-Module-Specification-Version: 1.6.2.1
OpenIDE-Module-Specification-Version: 1.7.3.0
23 changes: 21 additions & 2 deletions ts/compiler/binder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ namespace ts {
let container: Node;
let blockScopeContainer: Node;
let lastContainer: Node;
let seenThisKeyword: boolean;

// If this file is an external module, then it is automatically in strict-mode according to
// ES6. If it is not an external module, then we'll determine if it is in strict mode or
Expand Down Expand Up @@ -193,8 +194,9 @@ namespace ts {
function declareSymbol(symbolTable: SymbolTable, parent: Symbol, node: Declaration, includes: SymbolFlags, excludes: SymbolFlags): Symbol {
Debug.assert(!hasDynamicName(node));

let isDefaultExport = node.flags & NodeFlags.Default;
// The exported symbol for an export default function/class node is always named "default"
let name = node.flags & NodeFlags.Default && parent ? "default" : getDeclarationName(node);
let name = isDefaultExport && parent ? "default" : getDeclarationName(node);

let symbol: Symbol;
if (name !== undefined) {
Expand Down Expand Up @@ -235,6 +237,13 @@ namespace ts {
let message = symbol.flags & SymbolFlags.BlockScopedVariable
? Diagnostics.Cannot_redeclare_block_scoped_variable_0
: Diagnostics.Duplicate_identifier_0;

forEach(symbol.declarations, declaration => {
if (declaration.flags & NodeFlags.Default) {
message = Diagnostics.A_module_cannot_have_multiple_default_exports;
}
});

forEach(symbol.declarations, declaration => {
file.bindDiagnostics.push(createDiagnosticForNode(declaration.name || declaration, message, getDisplayName(declaration)));
});
Expand Down Expand Up @@ -338,7 +347,14 @@ namespace ts {
blockScopeContainer.locals = undefined;
}

forEachChild(node, bind);
if (node.kind === SyntaxKind.InterfaceDeclaration) {
seenThisKeyword = false;
forEachChild(node, bind);
node.flags = seenThisKeyword ? node.flags | NodeFlags.ContainsThis : node.flags & ~NodeFlags.ContainsThis;
}
else {
forEachChild(node, bind);
}

container = saveContainer;
parent = saveParent;
Expand Down Expand Up @@ -860,6 +876,9 @@ namespace ts {
return checkStrictModePrefixUnaryExpression(<PrefixUnaryExpression>node);
case SyntaxKind.WithStatement:
return checkStrictModeWithStatement(<WithStatement>node);
case SyntaxKind.ThisKeyword:
seenThisKeyword = true;
return;

case SyntaxKind.TypeParameter:
return declareSymbolAndAddToSymbolTable(<Declaration>node, SymbolFlags.TypeParameter, SymbolFlags.TypeParameterExcludes);
Expand Down
Loading

0 comments on commit ede8113

Please sign in to comment.