_id
stringlengths
21
254
text
stringlengths
1
93.7k
metadata
dict
TypeScript/tests/cases/conformance/es2019/globalThisPropertyAssignment.ts_0_239
// @allowJs: true // @checkJs: true // @noEmit: true // @Filename: globalThisPropertyAssignment.js this.x = 1 var y = 2 // should work in JS window.z = 3 // should work in JS (even though it's a secondary declaration) globalThis.alpha = 4
{ "end_byte": 239, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es2019/globalThisPropertyAssignment.ts" }
TypeScript/tests/cases/conformance/es2019/globalThisVarDeclaration.ts_0_488
// @outFile: output.js // @target: esnext // @lib: esnext, dom // @Filename: b.js // @allowJs: true // @checkJs: true var a = 10; this.a; this.b; globalThis.a; globalThis.b; // DOM access is not supported until the index signature is handled more strictly self.a; self.b; window.a; window.b; top.a; top.b; // @Filename...
{ "end_byte": 488, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es2019/globalThisVarDeclaration.ts" }
TypeScript/tests/cases/conformance/es2019/importMeta/importMeta.ts_1_1188
// @target: esnext,es5 // @module: esnext,commonjs,system,es2020 // @lib: es5,dom // @Filename: example.ts // Adapted from https://github.com/tc39/proposal-import-meta/tree/c3902a9ffe2e69a7ac42c19d7ea74cbdcea9b7fb#example (async () => { const response = await fetch(new URL("../hamsters.jpg", import.meta.url).toStrin...
{ "end_byte": 1188, "start_byte": 1, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es2019/importMeta/importMeta.ts" }
TypeScript/tests/cases/conformance/es2019/importMeta/importMetaNarrowing.ts_0_158
// @module: esnext,system,es2020 // @strict: true declare global { interface ImportMeta {foo?: () => void} }; if (import.meta.foo) { import.meta.foo(); }
{ "end_byte": 158, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es2019/importMeta/importMetaNarrowing.ts" }
TypeScript/tests/cases/conformance/es2021/es2021LocalesObjectArgument.ts_0_292
// @target: es2021 const enUS = new Intl.Locale("en-US"); const deDE = new Intl.Locale("de-DE"); const jaJP = new Intl.Locale("ja-JP"); new Intl.ListFormat(enUS); new Intl.ListFormat([deDE, jaJP]); Intl.ListFormat.supportedLocalesOf(enUS); Intl.ListFormat.supportedLocalesOf([deDE, jaJP]);
{ "end_byte": 292, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es2021/es2021LocalesObjectArgument.ts" }
TypeScript/tests/cases/conformance/es2021/intlDateTimeFormatRangeES2021.ts_0_162
// @lib: es2021 new Intl.DateTimeFormat().formatRange(new Date(0), new Date()); const [ part ] = new Intl.DateTimeFormat().formatRangeToParts(1000, 1000000000);
{ "end_byte": 162, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es2021/intlDateTimeFormatRangeES2021.ts" }
TypeScript/tests/cases/conformance/es2021/logicalAssignment/logicalAssignment4.ts_0_1151
// @strict: true // @target: esnext, es2021, es2020, es2015 // @allowUnreachableCode: false function foo1(results: number[] | undefined) { (results ||= []).push(100); } function foo2(results: number[] | undefined) { (results ??= []).push(100); } function foo3(results: number[] | undefined) { results ||= ...
{ "end_byte": 1151, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es2021/logicalAssignment/logicalAssignment4.ts" }
TypeScript/tests/cases/conformance/es2021/logicalAssignment/logicalAssignment1.ts_0_439
// @strict: true // @target: esnext, es2021, es2020, es2015 declare let a: string | undefined declare let b: string | undefined declare let c: string | undefined declare let d: number | undefined declare let e: number | undefined declare let f: number | undefined declare let g: 0 | 1 | 42 declare let h: 0 | 1 | 42 de...
{ "end_byte": 439, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es2021/logicalAssignment/logicalAssignment1.ts" }
TypeScript/tests/cases/conformance/es2021/logicalAssignment/logicalAssignment5.ts_0_552
// @strict: true // @target: esnext, es2021, es2020, es2015 function foo1 (f?: (a: number) => void) { f ??= (a => a) f(42) } function foo2 (f?: (a: number) => void) { f ||= (a => a) f(42) } function foo3 (f?: (a: number) => void) { f &&= (a => a) f(42) } function bar1 (f?: (a: number) => voi...
{ "end_byte": 552, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es2021/logicalAssignment/logicalAssignment5.ts" }
TypeScript/tests/cases/conformance/es2021/logicalAssignment/logicalAssignment10.ts_0_196
// @target: esnext, es2021, es2020, es2015 var count = 0; var obj = {}; function incr() { return ++count; } const oobj = { obj } obj[incr()] ??= incr(); oobj["obj"][incr()] ??= incr();
{ "end_byte": 196, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es2021/logicalAssignment/logicalAssignment10.ts" }
TypeScript/tests/cases/conformance/es2021/logicalAssignment/logicalAssignment2.ts_0_611
// @strict: true // @target: esnext, es2021, es2020, es2015 interface A { foo: { bar(): { baz: 0 | 1 | 42 | undefined | '' } baz: 0 | 1 | 42 | undefined | '' } baz: 0 | 1 | 42 | undefined | '' } declare const result: A declare const a: A declare const b: A declare const ...
{ "end_byte": 611, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es2021/logicalAssignment/logicalAssignment2.ts" }
TypeScript/tests/cases/conformance/es2021/logicalAssignment/logicalAssignment6.ts_0_447
// @strict: true // @target: esnext, es2021, es2020, es2015 function foo1(results: number[] | undefined, results1: number[] | undefined) { (results ||= (results1 ||= [])).push(100); } function foo2(results: number[] | undefined, results1: number[] | undefined) { (results ??= (results1 ??= [])).push(100); } f...
{ "end_byte": 447, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es2021/logicalAssignment/logicalAssignment6.ts" }
TypeScript/tests/cases/conformance/es2021/logicalAssignment/logicalAssignment7.ts_0_441
// @strict: true // @target: esnext, es2021, es2020, es2015 function foo1(results: number[] | undefined, results1: number[] | undefined) { (results ||= results1 ||= []).push(100); } function foo2(results: number[] | undefined, results1: number[] | undefined) { (results ??= results1 ??= []).push(100); } funct...
{ "end_byte": 441, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es2021/logicalAssignment/logicalAssignment7.ts" }
TypeScript/tests/cases/conformance/es2021/logicalAssignment/logicalAssignment3.ts_0_273
// @strict: true // @target: esnext, es2021, es2020, es2015 interface A { baz: 0 | 1 | 42 | undefined | '' } declare const result: A; declare const a: A; declare const b: A; declare const c: A; (a.baz) &&= result.baz; (b.baz) ||= result.baz; (c.baz) ??= result.baz;
{ "end_byte": 273, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es2021/logicalAssignment/logicalAssignment3.ts" }
TypeScript/tests/cases/conformance/es2021/logicalAssignment/logicalAssignment8.ts_0_401
// @strict: true // @target: esnext, es2021, es2020, es2015 declare const bar: { value?: number[] } | undefined function foo1(results: number[] | undefined) { (results ||= bar?.value ?? []).push(100); } function foo2(results: number[] | undefined) { (results ??= bar?.value ?? []).push(100); } function foo3(...
{ "end_byte": 401, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es2021/logicalAssignment/logicalAssignment8.ts" }
TypeScript/tests/cases/conformance/es2021/logicalAssignment/logicalAssignment9.ts_0_79
// @strict: true declare let x: { a?: boolean }; x.a ??= true; x.a &&= false;
{ "end_byte": 79, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es2021/logicalAssignment/logicalAssignment9.ts" }
TypeScript/tests/cases/conformance/ambient/ambientExternalModuleInsideNonAmbientExternalModule.ts_0_44
//@module: amd export declare module "M" { }
{ "end_byte": 44, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/ambient/ambientExternalModuleInsideNonAmbientExternalModule.ts" }
TypeScript/tests/cases/conformance/ambient/ambientShorthand_duplicate.ts_0_243
// @Filename: declarations1.d.ts declare module "foo"; // @Filename: declarations2.d.ts declare module "foo"; // @Filename: user.ts ///<reference path="declarations1.d.ts" /> ///<reference path="declarations1.d.ts" /> import foo from "foo";
{ "end_byte": 243, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/ambient/ambientShorthand_duplicate.ts" }
TypeScript/tests/cases/conformance/ambient/ambientModuleDeclarationWithReservedIdentifierInDottedPath.ts_0_266
// @declaration: true // https://github.com/microsoft/TypeScript/issues/7840 declare module chrome.debugger { declare var tabId: number; } export const tabId = chrome.debugger.tabId; declare module test.class {} declare module debugger {} // still an error
{ "end_byte": 266, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/ambient/ambientModuleDeclarationWithReservedIdentifierInDottedPath.ts" }
TypeScript/tests/cases/conformance/ambient/ambientDeclarationsPatterns_merging1.ts_0_274
// @filename: types.ts declare module "*.foo" { let everywhere: string; } // @filename: testA.ts import { everywhere, onlyInA } from "a.foo"; declare module "a.foo" { let onlyInA: number; } // @filename: testB.ts import { everywhere, onlyInA } from "b.foo"; // Error
{ "end_byte": 274, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/ambient/ambientDeclarationsPatterns_merging1.ts" }
TypeScript/tests/cases/conformance/ambient/ambientDeclarationsExternal.ts_1_550
//@Filename: decls.ts // Ambient external module with export assignment declare module 'equ' { var x; export = x; } declare module 'equ2' { var x: number; } // Ambient external import declaration referencing ambient external module using top level module name //@Filename: consumer.ts /// <reference path="...
{ "end_byte": 550, "start_byte": 1, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/ambient/ambientDeclarationsExternal.ts" }
TypeScript/tests/cases/conformance/ambient/ambientDeclarationsPatterns_tooManyAsterisks.ts_0_40
declare module "too*many*asterisks" { }
{ "end_byte": 40, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/ambient/ambientDeclarationsPatterns_tooManyAsterisks.ts" }
TypeScript/tests/cases/conformance/ambient/ambientErrors.ts_0_1415
// Ambient variable with an initializer declare var x = 4; // Ambient functions with invalid overloads declare function fn(x: number): string; declare function fn(x: 'foo'): number; // Ambient functions with duplicate signatures declare function fn1(x: number): string; declare function fn1(x: number): string; // Am...
{ "end_byte": 1415, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/ambient/ambientErrors.ts" }
TypeScript/tests/cases/conformance/ambient/ambientEnumDeclaration1.ts_3_230
In ambient enum declarations, all values specified in enum member declarations must be classified as constant enum expressions. declare enum E { a = 10, b = 10 + 1, c = b, d = (c) + 1, e = 10 << 2 * 8, }
{ "end_byte": 230, "start_byte": 3, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/ambient/ambientEnumDeclaration1.ts" }
TypeScript/tests/cases/conformance/ambient/ambientEnumDeclaration2.ts_3_313
In ambient enum declarations that specify no const modifier, enum member declarations // that omit a value are considered computed members (as opposed to having auto- incremented values assigned). declare enum E { a, // E.a b, // E.b } declare const enum E1 { a, // E.a = 0 b, // E.b = 1 }
{ "end_byte": 313, "start_byte": 3, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/ambient/ambientEnumDeclaration2.ts" }
TypeScript/tests/cases/conformance/ambient/ambientShorthand_declarationEmit.ts_0_44
// @declaration: true declare module "foo";
{ "end_byte": 44, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/ambient/ambientShorthand_declarationEmit.ts" }
TypeScript/tests/cases/conformance/ambient/ambientShorthand.ts_0_280
// @Filename: declarations.d.ts declare module "jquery" // Semicolon is optional declare module "fs"; // @Filename: user.ts ///<reference path="declarations.d.ts"/> import foo, {bar} from "jquery"; import * as baz from "fs"; import boom = require("jquery"); foo(bar, baz, boom);
{ "end_byte": 280, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/ambient/ambientShorthand.ts" }
TypeScript/tests/cases/conformance/ambient/ambientDeclarationsPatterns.ts_0_583
// @Filename: declarations.d.ts declare module "foo*baz" { export function foo(s: string): void; } // Augmentations still work declare module "foo*baz" { export const baz: string; } // Longest prefix wins declare module "foos*" { export const foos: string; } declare module "*!text" { const x: string; ...
{ "end_byte": 583, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/ambient/ambientDeclarationsPatterns.ts" }
TypeScript/tests/cases/conformance/ambient/ambientShorthand_reExport.ts_0_310
// @Filename: declarations.d.ts declare module "jquery"; // @Filename: reExportX.ts export {x} from "jquery"; // @Filename: reExportAll.ts export * from "jquery"; // @Filename: reExportUser.ts import {x} from "./reExportX"; import * as $ from "./reExportAll"; // '$' is not callable, it is an object. x($);
{ "end_byte": 310, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/ambient/ambientShorthand_reExport.ts" }
TypeScript/tests/cases/conformance/ambient/ambientShorthand_merging.ts_0_283
// @Filename: declarations1.d.ts declare module "foo"; // @Filename: declarations2.d.ts declare module "foo" { export const bar: number; } // @Filename: user.ts ///<reference path="declarations1.d.ts" /> ///<reference path="declarations1.d.ts" /> import foo, {bar} from "foo";
{ "end_byte": 283, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/ambient/ambientShorthand_merging.ts" }
TypeScript/tests/cases/conformance/ambient/ambientExternalModuleInsideNonAmbient.ts_0_46
module M { export declare module "M" { } }
{ "end_byte": 46, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/ambient/ambientExternalModuleInsideNonAmbient.ts" }
TypeScript/tests/cases/conformance/ambient/ambientExternalModuleMerging.ts_0_297
//@filename: ambientExternalModuleMerging_use.ts //@module: amd import M = require("M"); // Should be strings var x = M.x; var y = M.y; //@filename: ambientExternalModuleMerging_declare.ts declare module "M" { export var x: string; } // Merge declare module "M" { export var y: string; }
{ "end_byte": 297, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/ambient/ambientExternalModuleMerging.ts" }
TypeScript/tests/cases/conformance/ambient/ambientDeclarationsPatterns_merging2.ts_0_353
// @filename: types.ts declare module "*.foo" { let everywhere: string; } // @filename: testA.ts import { everywhere, onlyInA, alsoOnlyInA } from "a.foo"; declare module "a.foo" { let onlyInA: number; } // @filename: testB.ts import { everywhere, onlyInA, alsoOnlyInA } from "b.foo"; // Error declare module "a.fo...
{ "end_byte": 353, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/ambient/ambientDeclarationsPatterns_merging2.ts" }
TypeScript/tests/cases/conformance/ambient/ambientInsideNonAmbientExternalModule.ts_0_147
// @module: amd export declare var x; export declare function f(); export declare class C { } export declare enum E { } export declare module M { }
{ "end_byte": 147, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/ambient/ambientInsideNonAmbientExternalModule.ts" }
TypeScript/tests/cases/conformance/ambient/ambientDeclarationsPatterns_merging3.ts_0_248
// @filename: types.ts declare module "*.foo" { export interface OhNo { star: string } } // @filename: test.ts declare module "a.foo" { export interface OhNo { a: string } } import { OhNo } from "b.foo" declare let ohno: OhNo; ohno.a // oh no
{ "end_byte": 248, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/ambient/ambientDeclarationsPatterns_merging3.ts" }
TypeScript/tests/cases/conformance/ambient/ambientInsideNonAmbient.ts_0_296
module M { export declare var x; export declare function f(); export declare class C { } export declare enum E { } export declare module M { } } module M2 { declare var x; declare function f(); declare class C { } declare enum E { } declare module M { } }
{ "end_byte": 296, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/ambient/ambientInsideNonAmbient.ts" }
TypeScript/tests/cases/conformance/ambient/ambientDeclarations.ts_0_1521
// Ambient variable without type annotation declare var n; // Ambient variable with type annotation declare var m: string; // Ambient function with no type annotations declare function fn1(); // Ambient function with type annotations declare function fn2(n: string): number; // Ambient function with valid overloads ...
{ "end_byte": 1521, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/ambient/ambientDeclarations.ts" }
TypeScript/tests/cases/conformance/ambient/ambientModuleDeclarationWithReservedIdentifierInDottedPath2.ts_0_219
// @declaration: true declare namespace chrome.debugger { declare var tabId: number; } export const tabId = chrome.debugger.tabId; declare namespace test.class {} declare namespace debugger {} // still an error
{ "end_byte": 219, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/ambient/ambientModuleDeclarationWithReservedIdentifierInDottedPath2.ts" }
TypeScript/tests/cases/conformance/salsa/importingExportingTypes.ts_0_521
// @allowJs: true // @checkJs: true // @noEmit: true // @Filename: /node_modules/@types/node/index.d.ts declare module "fs" { export interface WriteFileOptions {} export function writeFile(path: string, data: any, options: WriteFileOptions, callback: (err: Error) => void): void; } // @Filename: /index.js import {...
{ "end_byte": 521, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/salsa/importingExportingTypes.ts" }
TypeScript/tests/cases/conformance/salsa/typeFromPropertyAssignment9.ts_0_871
// @noEmit: true // @allowJs: true // @checkJs: true // @target: es6 // @Filename: a.js var my = my || {}; /** @param {number} n */ my.method = function(n) { return n + 1; } my.number = 1; my.object = {}; my.predicate = my.predicate || {}; my.predicate.query = function () { var me = this; me.property = fal...
{ "end_byte": 871, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/salsa/typeFromPropertyAssignment9.ts" }
TypeScript/tests/cases/conformance/salsa/typeFromPropertyAssignment10_1.ts_0_1039
// @noEmit: true // @allowJs: true // @checkJs: true // @target: esnext // @Filename: module.js var Outer = Outer ?? {}; Outer.app = Outer.app ?? {}; // @Filename: someview.js Outer.app.SomeView = (function () { var SomeView = function() { var me = this; } return SomeView; })(); Outer.app.Inner = c...
{ "end_byte": 1039, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/salsa/typeFromPropertyAssignment10_1.ts" }
TypeScript/tests/cases/conformance/salsa/moduleExportAliasUnknown.ts_0_131
// @allowJs: true // @noEmit: true // @checkJs: true // @Filename: bug27025.js module.exports = window.nonprop; exports.foo = bar;
{ "end_byte": 131, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/salsa/moduleExportAliasUnknown.ts" }
TypeScript/tests/cases/conformance/salsa/moduleExportsAliasLoop1.ts_0_111
// @noEmit: true // @allowJs: true // @checkJs: true // @filename: x.js exports.fn1(); exports.fn2 = Math.min;
{ "end_byte": 111, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/salsa/moduleExportsAliasLoop1.ts" }
TypeScript/tests/cases/conformance/salsa/commonJSImportClassTypeReference.ts_0_294
// @allowJs: true // @checkJs: true // @strict: true // @outDir: out // @declaration: true // @filename: main.js const { K } = require("./mod1"); /** @param {K} k */ function f(k) { k.values() } // @filename: mod1.js class K { values() { return new K() } } exports.K = K;
{ "end_byte": 294, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/salsa/commonJSImportClassTypeReference.ts" }
TypeScript/tests/cases/conformance/salsa/plainJSTypeErrors.ts_0_162
// @outdir: out/ // @target: esnext // @allowJS: true // @filename: plainJSTypeErrors.js // should error if ({} === {}) {} // should not error if ({} == {}) {}
{ "end_byte": 162, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/salsa/plainJSTypeErrors.ts" }
TypeScript/tests/cases/conformance/salsa/thisPropertyAssignmentComputed.ts_0_138
// @allowjs: true // @checkjs: true // @noemit: true // @strict: true // @filename: thisPropertyAssignmentComputed.js this["a" + "b"] = 0
{ "end_byte": 138, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/salsa/thisPropertyAssignmentComputed.ts" }
TypeScript/tests/cases/conformance/salsa/typeLookupInIIFE.ts_0_172
// @noEmit: true // @allowJs: true // @checkJs: true // @noImplicitAny: true // @Filename: a.js // #22973 var ns = (function() {})(); /** @type {ns.NotFound} */ var crash;
{ "end_byte": 172, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/salsa/typeLookupInIIFE.ts" }
TypeScript/tests/cases/conformance/salsa/lateBoundAssignmentDeclarationSupport4.ts_0_570
// @allowJs: true // @checkJs: true // @noEmit: true // @strict: true // @target: es6 // @filename: lateBoundAssignmentDeclarationSupport4.js // currently unsupported const _sym = Symbol(); const _str = "my-fake-sym"; function F() { } F.prototype[_sym] = "ok"; F.prototype[_str] = "ok"; const inst = new F(); const _y ...
{ "end_byte": 570, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/salsa/lateBoundAssignmentDeclarationSupport4.ts" }
TypeScript/tests/cases/conformance/salsa/thisTypeOfConstructorFunctions.ts_0_741
// @Filename: thisTypeOfConstructorFunctions.js // @allowJs: true // @checkJs: true // @noEmit: true /** * @class * @template T * @param {T} t */ function Cp(t) { /** @type {this} */ this.dit = this this.y = t /** @return {this} */ this.m3 = () => this } Cp.prototype = { /** @return {this}...
{ "end_byte": 741, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/salsa/thisTypeOfConstructorFunctions.ts" }
TypeScript/tests/cases/conformance/salsa/moduleExportWithExportPropertyAssignment.ts_0_458
// @noEmit: true // @allowJs: true // @checkJs: true // @Filename: requires.d.ts declare var module: { exports: any }; declare function require(name: string): any; // @Filename: mod1.js /// <reference path='./requires.d.ts' /> module.exports = function () { } /** @param {number} a */ module.exports.f = function (a) { }...
{ "end_byte": 458, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/salsa/moduleExportWithExportPropertyAssignment.ts" }
TypeScript/tests/cases/conformance/salsa/typeFromPrototypeAssignment2.ts_0_821
// @noEmit: true // @allowJs: true // @checkJs: true // @Filename: a.js // @strict: true // non top-level: // all references to _map, set, get, addon should be ok (function container() { /** @constructor */ var Multimap = function() { this._map = {}; this._map this.set this.get ...
{ "end_byte": 821, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/salsa/typeFromPrototypeAssignment2.ts" }
TypeScript/tests/cases/conformance/salsa/typeTagOnFunctionReferencesGeneric.ts_0_352
// @checkJs: true // @declaration: true // @outDir: out/ // @filename: typeTagOnFunctionReferencesGeneric.js /** * @typedef {<T>(m : T) => T} IFn */ /**@type {IFn}*/ export function inJs(l) { return l; } inJs(1); // lints error. Why? /**@type {IFn}*/ const inJsArrow = (j) => { return j; } inJsArrow(2); // n...
{ "end_byte": 352, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/salsa/typeTagOnFunctionReferencesGeneric.ts" }
TypeScript/tests/cases/conformance/salsa/typeFromJSInitializer4.ts_0_501
// @allowJs: true // @checkJs: true // @noEmit: true // @strictNullChecks: false // @noImplicitAny: true // @Filename: a.js /** @type {number | undefined} */ var n; // should get any on parameter initialisers function f(a = null, b = n, l = []) { // a should be any a = undefined a = null a = 1 a =...
{ "end_byte": 501, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/salsa/typeFromJSInitializer4.ts" }
TypeScript/tests/cases/conformance/salsa/typeFromPropertyAssignmentWithExport.ts_0_222
// @allowJs: true // @checkJs: true // @Filename: a.js // @outDir: dist // this is a javascript file... export const Adapter = {}; Adapter.prop = {}; // comment this out, and it works Adapter.asyncMethod = function() {}
{ "end_byte": 222, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/salsa/typeFromPropertyAssignmentWithExport.ts" }
TypeScript/tests/cases/conformance/salsa/typeFromJSInitializer.ts_0_1192
// @allowJs: true // @checkJs: true // @noEmit: true // @strictNullChecks: true // @noImplicitAny: true // @Filename: a.js function A () { // should get any on this-assignments in constructor this.unknown = null this.unknowable = undefined this.empty = [] } var a = new A() a.unknown = 1 a.unknown = true...
{ "end_byte": 1192, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/salsa/typeFromJSInitializer.ts" }
TypeScript/tests/cases/conformance/salsa/propertyAssignmentOnParenthesizedNumber.ts_0_175
// @allowJs: true // @checkJs: true // @noEmit: true // @Filename: bug38934.js var x = {}; // should not crash and also should not result in a property '0' on x. x[(0)] = 1;
{ "end_byte": 175, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/salsa/propertyAssignmentOnParenthesizedNumber.ts" }
TypeScript/tests/cases/conformance/salsa/unannotatedParametersAreOptional.ts_0_367
// @allowJs: true // @checkJs: true // @noEmit: true // @Filename: test.js function f(x) {} f(); // Always been ok class C { static m(x) {} p = x => {} m(x) {} } C.m(); // Always been ok new C().m(); // Regression #39261 new C().p(); // Regression #39261 const obj = { m(x) {}, p: x => {} }; obj.m()...
{ "end_byte": 367, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/salsa/unannotatedParametersAreOptional.ts" }
TypeScript/tests/cases/conformance/salsa/assignmentToVoidZero2.ts_0_395
// @filename: assignmentToVoidZero2.js // @declaration: true // @module: commonjs // @outdir: auss // @checkJs: true // @allowJs: true // @noImplicitAny: true exports.j = 1; exports.k = void 0; var o = {} o.x = 1 o.y = void 0 o.x + o.y function C() { this.p = 1 this.q = void 0 } var c = new C() c.p + c.q // @...
{ "end_byte": 395, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/salsa/assignmentToVoidZero2.ts" }
TypeScript/tests/cases/conformance/salsa/typeFromPrototypeAssignment3.ts_0_386
// @noEmit: true // @allowJs: true // @checkJs: true // @Filename: bug26885.js // @strict: true function Multimap3() { this._map = {}; }; Multimap3.prototype = { /** * @param {string} key * @returns {number} the value ok */ get(key) { return this._map[key + '']; } } /** @type {...
{ "end_byte": 386, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/salsa/typeFromPrototypeAssignment3.ts" }
TypeScript/tests/cases/conformance/salsa/requireAssertsFromTypescript.ts_0_417
// @noEmit: true // @allowJs: true // @checkJs: true // @Filename: ex.d.ts // based on assert in @types/node export function art(value: any, message?: string | Error): asserts value; // @Filename: ex2.d.ts declare function art(value: any, message?: string | Error): asserts value; export = art; // @Filename: 38379.js co...
{ "end_byte": 417, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/salsa/requireAssertsFromTypescript.ts" }
TypeScript/tests/cases/conformance/salsa/lateBoundAssignmentDeclarationSupport1.ts_0_416
// @allowJs: true // @checkJs: true // @noEmit: true // @strict: true // @target: es6 // @filename: lateBoundAssignmentDeclarationSupport1.js // currently unsupported const _sym = Symbol(); const _str = "my-fake-sym"; exports[_sym] = "ok"; exports[_str] = "ok"; exports.S = _sym; // @filename: usage.js const x = requir...
{ "end_byte": 416, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/salsa/lateBoundAssignmentDeclarationSupport1.ts" }
TypeScript/tests/cases/conformance/salsa/moduleExportAliasElementAccessExpression.ts_0_275
// @declaration: true // @checkJs: true // @filename: moduleExportAliasElementAccessExpression.js // @outdir: out function D () { } exports["D"] = D; // (the only package I could find that uses spaces in identifiers is webidl-conversions) exports["Does not work yet"] = D;
{ "end_byte": 275, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/salsa/moduleExportAliasElementAccessExpression.ts" }
TypeScript/tests/cases/conformance/salsa/typeFromPropertyAssignment8.ts_0_480
// @noEmit: true // @allowJs: true // @checkJs: true // @target: es6 // @lib: es6,dom // @Filename: a.js var my = my || {}; my.app = my.app || {}; my.app.Application = (function () { var Application = function () { //... }; return Application; })(); my.app.Application() // @Filename: b.js var min = window.min || ...
{ "end_byte": 480, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/salsa/typeFromPropertyAssignment8.ts" }
TypeScript/tests/cases/conformance/salsa/typeFromPrototypeAssignment.ts_0_644
// @noEmit: true // @allowJs: true // @checkJs: true // @Filename: a.js // @strict: true // all references to _map, set, get, addon should be ok /** @constructor */ var Multimap = function() { this._map = {}; this._map this.set this.get this.addon }; Multimap.prototype = { set: function() { ...
{ "end_byte": 644, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/salsa/typeFromPrototypeAssignment.ts" }
TypeScript/tests/cases/conformance/salsa/malformedTags.ts_0_194
// @allowJS: true // @suppressOutputPathCheck: true // @filename: myFile02.js /** * Checks if `value` is classified as an `Array` object. * * @type Function */ var isArray = Array.isArray;
{ "end_byte": 194, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/salsa/malformedTags.ts" }
TypeScript/tests/cases/conformance/salsa/typeFromContextualThisType.ts_0_372
// @noEmit: true // @allowJs: true // @checkJs: true // @strict: true // @Filename: bug25926.js /** @type {{ a(): void; b?(n: number): number; }} */ const o1 = { a() { this.b = n => n; } }; /** @type {{ d(): void; e?(n: number): number; f?(n: number): number; g?: number }} */ const o2 = { d() { ...
{ "end_byte": 372, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/salsa/typeFromContextualThisType.ts" }
TypeScript/tests/cases/conformance/salsa/lateBoundClassMemberAssignmentJS.ts_0_357
// @allowJs: true // @checkJs: true // @emitDeclarationOnly: true // @strict: true // @target: es6 // @declaration: true // @filename: lateBoundClassMemberAssignmentJS.js const _sym = Symbol("_sym"); export class MyClass { constructor() { this[_sym] = "ok"; } method() { this[_sym] = "yep"; ...
{ "end_byte": 357, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/salsa/lateBoundClassMemberAssignmentJS.ts" }
TypeScript/tests/cases/conformance/salsa/commonJSImportNestedClassTypeReference.ts_0_316
// @allowJs: true // @checkJs: true // @strict: true // @outDir: out // @declaration: true // @filename: main.js const { K } = require("./mod1"); /** @param {K} k */ function f(k) { k.values() } // @filename: mod1.js var NS = {} NS.K =class { values() { return new NS.K() } } exports.K = NS.K;
{ "end_byte": 316, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/salsa/commonJSImportNestedClassTypeReference.ts" }
TypeScript/tests/cases/conformance/salsa/constructorFunctionMethodTypeParameters.ts_0_620
// @noEmit: true // @allowJs: true // @checkJs: true // @filename: constructorFunctionMethodTypeParameters.js /** * @template {string} T * @param {T} t */ function Cls(t) { this.t = t; } /** * @template {string} V * @param {T} t * @param {V} v * @return {V} */ Cls.prototype.topLevelComment = function (t, v...
{ "end_byte": 620, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/salsa/constructorFunctionMethodTypeParameters.ts" }
TypeScript/tests/cases/conformance/salsa/lateBoundAssignmentDeclarationSupport5.ts_0_571
// @allowJs: true // @checkJs: true // @noEmit: true // @strict: true // @target: es6 // @filename: lateBoundAssignmentDeclarationSupport5.js // currently unsupported const _sym = Symbol(); const _str = "my-fake-sym"; function F() { } F.prototype = { [_sym]: "ok", [_str]: "ok" } const inst = new F(); const _y...
{ "end_byte": 571, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/salsa/lateBoundAssignmentDeclarationSupport5.ts" }
TypeScript/tests/cases/conformance/salsa/jsContainerMergeTsDeclaration.ts_0_189
// @allowJs: true // @checkJs: true // @noEmit: true // @Filename: a.js var /*1*/x = function foo() { } x.a = function bar() { } // @Filename: b.ts var x = function () { return 1; }();
{ "end_byte": 189, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/salsa/jsContainerMergeTsDeclaration.ts" }
TypeScript/tests/cases/conformance/salsa/moduleExportNestedNamespaces.ts_0_443
// @allowJs: true // @checkJs: true // @noEmit: true // @Filename: mod.js module.exports.n = {}; module.exports.n.K = function C() { this.x = 10; } module.exports.Classic = class { constructor() { this.p = 1 } } // @Filename: use.js import * as s from './mod' var k = new s.n.K() k.x var classic =...
{ "end_byte": 443, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/salsa/moduleExportNestedNamespaces.ts" }
TypeScript/tests/cases/conformance/salsa/prototypePropertyAssignmentMergedTypeReference.ts_0_274
// https://github.com/microsoft/TypeScript/issues/33993 // @noEmit: true // @allowJs: true // @checkJS: true // @filename: prototypePropertyAssignmentMergedTypeReference.js var f = function() { return 12; }; f.prototype.a = "a"; /** @type {new () => f} */ var x = f;
{ "end_byte": 274, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/salsa/prototypePropertyAssignmentMergedTypeReference.ts" }
TypeScript/tests/cases/conformance/salsa/globalMergeWithCommonJSAssignmentDeclaration.ts_0_227
// @noEmit: true // @allowJs: true // @checkJs: true // @Filename: bug27099.js window.name = 1; window.console; // should not have error: Property 'console' does not exist on type 'typeof window'. module.exports = 'anything';
{ "end_byte": 227, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/salsa/globalMergeWithCommonJSAssignmentDeclaration.ts" }
TypeScript/tests/cases/conformance/salsa/inferringClassMembersFromAssignments4.ts_0_320
// @noEmit: true // @allowJs: true // @checkJs: true // @noImplicitAny: true // @strictNullChecks: true // @Filename: a.js class Base { m() { this.p = 1 } } class Derived extends Base { m() { // should be OK, and p should have type number | undefined from its base this.p = 1 } }
{ "end_byte": 320, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/salsa/inferringClassMembersFromAssignments4.ts" }
TypeScript/tests/cases/conformance/salsa/moduleExportAssignment5.ts_0_284
// @noEmit: true // @allowJs: true // @checkJs: true // @Filename: axios.js class Axios { constructor() { } m() { } } var axios = new Axios(); // none of the 3 references should have a use-before-def error axios.m() module.exports = axios; module.exports.default = axios;
{ "end_byte": 284, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/salsa/moduleExportAssignment5.ts" }
TypeScript/tests/cases/conformance/salsa/typeFromPropertyAssignment3.ts_0_259
// @noEmit: true // @allowJs: true // @checkJs: true // @Filename: a.js var Outer = function O() { this.y = 2 } Outer.Inner = class I { constructor() { this.x = 1 } } /** @type {Outer} */ var ja ja.y /** @type {Outer.Inner} */ var da da.x
{ "end_byte": 259, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/salsa/typeFromPropertyAssignment3.ts" }
TypeScript/tests/cases/conformance/salsa/typeFromPropertyAssignment20.ts_0_396
// @allowJs: true // @checkJs: true // @noEmit: true // @Filename: bluebird.js !function outer (f) { return f }( function inner () { function Async() { this._trampolineEnabled = true; } Async.prototype.disableTrampolineIfNecessary = function dtin(b) { if (b) { ...
{ "end_byte": 396, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/salsa/typeFromPropertyAssignment20.ts" }
TypeScript/tests/cases/conformance/salsa/requireTwoPropertyAccesses.ts_0_242
// @declaration // @outdir: out // @checkjs: true // @allowjs: true // @filename: mod.js module.exports = { x: { y: "value" } } // @filename: requireTwoPropertyAccesses.js const value = require("./mod").x.y console.log(value)
{ "end_byte": 242, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/salsa/requireTwoPropertyAccesses.ts" }
TypeScript/tests/cases/conformance/salsa/namespaceAssignmentToRequireAlias.ts_0_252
// @allowJs: true // @checkJs: true // @strict: true // @outDir: out // @declaration: true // @filename: node_modules/untyped/index.js module.exports = {} // @filename: bug40140.js const u = require('untyped'); u.assignment.nested = true u.noError()
{ "end_byte": 252, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/salsa/namespaceAssignmentToRequireAlias.ts" }
TypeScript/tests/cases/conformance/salsa/plainJSReservedStrict.ts_0_141
// @outdir: out/ // @target: esnext // @allowJS: true // @filename: plainJSReservedStrict.js "use strict" const eval = 1 const arguments = 2
{ "end_byte": 141, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/salsa/plainJSReservedStrict.ts" }
TypeScript/tests/cases/conformance/salsa/typeFromPropertyAssignment14.ts_0_316
// @noEmit: true // @allowJs: true // @checkJs: true // @Filename: def.js var Outer = {}; // @Filename: work.js Outer.Inner = function () {} Outer.Inner.prototype = { x: 1, m() { } } // @Filename: use.js /** @type {Outer.Inner} */ var inner inner.x inner.m() var inno = new Outer.Inner() inno.x inno.m()
{ "end_byte": 316, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/salsa/typeFromPropertyAssignment14.ts" }
TypeScript/tests/cases/conformance/salsa/prototypePropertyAssignmentMergeAcrossFiles.ts_0_217
// @Filename: prototypePropertyAssignmentMergeAcrossFiles.js // @allowJs: true // @checkJs: true // @noEmit: true function C() { this.a = 1 } // @Filename: other.js C.prototype.foo = function() { return this.a }
{ "end_byte": 217, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/salsa/prototypePropertyAssignmentMergeAcrossFiles.ts" }
TypeScript/tests/cases/conformance/salsa/typeFromPropertyAssignment30.ts_0_174
interface Combo { (): number; p?: { [s: string]: number }; } const c: Combo = () => 1 // should not be an expando object, but contextually typed by Combo.p c.p = {}
{ "end_byte": 174, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/salsa/typeFromPropertyAssignment30.ts" }
TypeScript/tests/cases/conformance/salsa/expandoOnAlias.ts_0_548
// @allowJs: true // @checkJs: true // @declaration: true // @emitDeclarationOnly: true // @Filename: vue.js export class Vue {} export const config = { x: 0 }; // @Filename: test.js import { Vue, config } from "./vue"; // Expando declarations aren't allowed on aliases. Vue.config = {}; new Vue(); // This is not an...
{ "end_byte": 548, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/salsa/expandoOnAlias.ts" }
TypeScript/tests/cases/conformance/salsa/moduleExportDuplicateAlias.ts_0_311
// @checkJs: true // @strict: true // @declaration: true // @outdir: out // @filename: moduleExportAliasDuplicateAlias.js exports.apply = undefined; function a() { } exports.apply() exports.apply = a; exports.apply() // @filename: test.js const { apply } = require('./moduleExportAliasDuplicateAlias') apply()
{ "end_byte": 311, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/salsa/moduleExportDuplicateAlias.ts" }
TypeScript/tests/cases/conformance/salsa/typeFromPropertyAssignment10.ts_0_1036
// @noEmit: true // @allowJs: true // @checkJs: true // @target: es6 // @Filename: module.js var Outer = Outer || {}; Outer.app = Outer.app || {}; // @Filename: someview.js Outer.app.SomeView = (function () { var SomeView = function() { var me = this; } return SomeView; })(); Outer.app.Inner = clas...
{ "end_byte": 1036, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/salsa/typeFromPropertyAssignment10.ts" }
TypeScript/tests/cases/conformance/salsa/propertyAssignmentOnUnresolvedImportedSymbol.ts_0_122
// @allowJs: true // @checkJs: true // @noEmit: true // @Filename: bug28576.js import x from 'arglebaz' { x.bar = 1 }
{ "end_byte": 122, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/salsa/propertyAssignmentOnUnresolvedImportedSymbol.ts" }
TypeScript/tests/cases/conformance/salsa/typeFromPropertyAssignment7.ts_0_175
// @noEmit: true // @allowJs: true // @checkJs: true // @target: es6 // @Filename: a.js var obj = {}; obj.method = function (hunch) { return true; } var b = obj.method();
{ "end_byte": 175, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/salsa/typeFromPropertyAssignment7.ts" }
TypeScript/tests/cases/conformance/salsa/constructorFunctionsStrict.ts_0_456
// @noEmit: true // @allowJs: true // @checkJs: true // @strict: true // @noImplicitThis: false // @Filename: a.js /** @param {number} x */ function C(x) { this.x = x } C.prototype.m = function() { this.y = 12 } var c = new C(1) c.x = undefined // should error c.y = undefined // ok /** @param {number} x */ f...
{ "end_byte": 456, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/salsa/constructorFunctionsStrict.ts" }
TypeScript/tests/cases/conformance/salsa/typeFromPropertyAssignment24.ts_0_369
// @noEmit: true // @checkJs: true // @allowJs: true // @Filename: usage.js // note that usage is first in the compilation Outer.Inner.Message = function() { }; var y = new Outer.Inner() y.name /** @type {Outer.Inner} should be instance type, not static type */ var x; x.name // @Filename: def.js var Outer = {} Outer....
{ "end_byte": 369, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/salsa/typeFromPropertyAssignment24.ts" }
TypeScript/tests/cases/conformance/salsa/typeFromPropertyAssignment34.ts_0_181
// @noEmit: true // @allowjs: true // @checkjs: true // @Filename: file1.js var N = {}; N.commands = {}; // @Filename: file2.js N.commands.a = 111; N.commands.b = function () { };
{ "end_byte": 181, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/salsa/typeFromPropertyAssignment34.ts" }
TypeScript/tests/cases/conformance/salsa/moduleExportWithExportPropertyAssignment4.ts_0_641
// @noEmit: true // @allowJs: true // @checkJs: true // @Filename: requires.d.ts declare var module: { exports: any }; declare function require(name: string): any; // @Filename: mod1.js /// <reference path='./requires.d.ts' /> module.exports.bothBefore = 'string' A.justExport = 4 A.bothBefore = 2 A.bothAfter = 3 module...
{ "end_byte": 641, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/salsa/moduleExportWithExportPropertyAssignment4.ts" }
TypeScript/tests/cases/conformance/salsa/plainJSGrammarErrors2.ts_0_231
// @outdir: out/ // @target: esnext // @module: esnext // @allowJs: true // @filename: plainJSGrammarErrors2.js // @filename: /a.js export default 1; // @filename: /b.js /** * @deprecated */ export { default as A } from "./a";
{ "end_byte": 231, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/salsa/plainJSGrammarErrors2.ts" }
TypeScript/tests/cases/conformance/salsa/commonJSImportExportedClassExpression.ts_0_269
// @allowJs: true // @checkJs: true // @strict: true // @outDir: out // @declaration: true // @filename: main.js const { K } = require("./mod1"); /** @param {K} k */ function f(k) { k.values() } // @filename: mod1.js exports.K = class K { values() { } };
{ "end_byte": 269, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/salsa/commonJSImportExportedClassExpression.ts" }
TypeScript/tests/cases/conformance/salsa/moduleExportAlias5.ts_0_221
// @checkJs: true // @allowJS: true // @noEmit: true // @Filename: bug24754.js // #24754 const webpack = function (){ } exports = module.exports = webpack; exports.version = 1001; webpack.WebpackOptionsDefaulter = 1111;
{ "end_byte": 221, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/salsa/moduleExportAlias5.ts" }
TypeScript/tests/cases/conformance/salsa/sourceFileMergeWithFunction.ts_0_196
// @Filename: types.d.ts declare function foo(props: any): any; export default foo; export as namespace foo; // @Filename: foo.ts /// <reference path="types.d.ts" /> declare function foo(): any;
{ "end_byte": 196, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/salsa/sourceFileMergeWithFunction.ts" }
TypeScript/tests/cases/conformance/salsa/propertyAssignmentUseParentType1.ts_0_304
interface N { (): boolean num: 123; } export const interfaced: N = () => true; interfaced.num = 123; export const inlined: { (): boolean; nun: 456 } = () => true; inlined.nun = 456; export const ignoreJsdoc = () => true; /** @type {string} make sure to ignore jsdoc! */ ignoreJsdoc.extra = 111
{ "end_byte": 304, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/salsa/propertyAssignmentUseParentType1.ts" }
TypeScript/tests/cases/conformance/salsa/typeFromPropertyAssignment11.ts_0_322
// @noEmit: true // @allowJs: true // @checkJs: true // @target: es6 // @Filename: module.js var Inner = function() {} Inner.prototype = { m() { }, i: 1 } // incremental assignments still work Inner.prototype.j = 2 /** @type {string} */ Inner.prototype.k; var inner = new Inner() inner.m() inner.i inner.j inner....
{ "end_byte": 322, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/salsa/typeFromPropertyAssignment11.ts" }
TypeScript/tests/cases/conformance/salsa/typeFromPropertyAssignment40.ts_0_188
// @noEmit: true // @allowJs: true // @checkJs: true // @Filename: typeFromPropertyAssignment40.js function Outer() { var self = this self.y = 2 } /** @type {Outer} */ var ok ok.y
{ "end_byte": 188, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/salsa/typeFromPropertyAssignment40.ts" }