mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-09 02:30:15 -06:00
Merge branch 'master' into typeBaselines
This commit is contained in:
commit
b13fb89d51
@ -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;
|
||||
|
||||
15
tests/baselines/reference/noDefaultLib.errors.txt
Normal file
15
tests/baselines/reference/noDefaultLib.errors.txt
Normal 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 {}
|
||||
15
tests/baselines/reference/noDefaultLib.js
Normal file
15
tests/baselines/reference/noDefaultLib.js
Normal 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;
|
||||
10
tests/cases/compiler/noDefaultLib.ts
Normal file
10
tests/cases/compiler/noDefaultLib.ts
Normal 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 {}
|
||||
12
tests/cases/fourslash/scriptLexicalStructureItems2.ts
Normal file
12
tests/cases/fourslash/scriptLexicalStructureItems2.ts
Normal 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);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user