Merge branch 'master' into typeBaselines

This commit is contained in:
Jason Freeman 2014-08-27 11:22:49 -07:00
commit b13fb89d51
5 changed files with 53 additions and 0 deletions

View File

@ -2238,6 +2238,7 @@ module ts {
return emptyObjectType;
}
var type = getDeclaredTypeOfSymbol(symbol);
var name = symbol.name;
if (!(type.flags & TypeFlags.ObjectType)) {
error(getTypeDeclaration(symbol), Diagnostics.Global_type_0_must_be_a_class_or_interface_type, symbol.name);
return emptyObjectType;

View File

@ -0,0 +1,15 @@
!!! Cannot find global type 'Boolean'.
!!! Cannot find global type 'IArguments'.
==== tests/cases/compiler/noDefaultLib.ts (1 errors) ====
/// <reference no-default-lib="true"/>
var x;
interface Array {}
~~~~~
!!! Global type 'Array' must have 1 type parameter(s).
interface String {}
interface Number {}
interface Object {}
interface Date {}
interface Function {}
interface RegExp {}

View File

@ -0,0 +1,15 @@
//// [noDefaultLib.ts]
/// <reference no-default-lib="true"/>
var x;
interface Array {}
interface String {}
interface Number {}
interface Object {}
interface Date {}
interface Function {}
interface RegExp {}
//// [noDefaultLib.js]
/// <reference no-default-lib="true"/>
var x;

View File

@ -0,0 +1,10 @@
/// <reference no-default-lib="true"/>
var x;
interface Array {}
interface String {}
interface Number {}
interface Object {}
interface Date {}
interface Function {}
interface RegExp {}

View File

@ -0,0 +1,12 @@
/// <reference path="fourslash.ts"/>
/////**/
goTo.marker();
edit.insertLine("module A");
edit.insert("export class ");
// should not crash
verify.getScriptLexicalStructureListCount(1);