mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-15 12:51:30 -05:00
Accepted baselines.
This commit is contained in:
@@ -0,0 +1,61 @@
|
||||
//// [tests/cases/compiler/taggedTemplatesInModuleAndGlobal.ts] ////
|
||||
|
||||
//// [global.ts]
|
||||
namespace n {
|
||||
function id<T>(x: T): T {
|
||||
return x;
|
||||
}
|
||||
|
||||
function templateObjectFactory() {
|
||||
return id`hello world`;
|
||||
}
|
||||
let result = templateObjectFactory() === templateObjectFactory();
|
||||
}
|
||||
//// [module.ts]
|
||||
export { }
|
||||
function id<T>(x: T): T {
|
||||
return x;
|
||||
}
|
||||
|
||||
function templateObjectFactory() {
|
||||
return id`hello world`;
|
||||
}
|
||||
let result = templateObjectFactory() === templateObjectFactory();
|
||||
|
||||
|
||||
//// [global.js]
|
||||
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
||||
if (Object.defineProperty) {
|
||||
return Object.defineProperty(cooked, "raw", { value: raw });
|
||||
}
|
||||
cooked.raw = raw;
|
||||
return cooked;
|
||||
};
|
||||
var n;
|
||||
(function (n) {
|
||||
function id(x) {
|
||||
return x;
|
||||
}
|
||||
function templateObjectFactory() {
|
||||
return id(__makeTemplateObject(["hello world"], ["hello world"]));
|
||||
}
|
||||
var result = templateObjectFactory() === templateObjectFactory();
|
||||
})(n || (n = {}));
|
||||
//// [module.js]
|
||||
"use strict";
|
||||
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
||||
if (Object.defineProperty) {
|
||||
return Object.defineProperty(cooked, "raw", { value: raw });
|
||||
}
|
||||
cooked.raw = raw;
|
||||
return cooked;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
function id(x) {
|
||||
return x;
|
||||
}
|
||||
function templateObjectFactory() {
|
||||
return id(_a || (_a = __makeTemplateObject(["hello world"], ["hello world"])));
|
||||
}
|
||||
var result = templateObjectFactory() === templateObjectFactory();
|
||||
var _a;
|
||||
@@ -0,0 +1,50 @@
|
||||
=== tests/cases/compiler/global.ts ===
|
||||
namespace n {
|
||||
>n : Symbol(n, Decl(global.ts, 0, 0))
|
||||
|
||||
function id<T>(x: T): T {
|
||||
>id : Symbol(id, Decl(global.ts, 0, 13))
|
||||
>T : Symbol(T, Decl(global.ts, 1, 16))
|
||||
>x : Symbol(x, Decl(global.ts, 1, 19))
|
||||
>T : Symbol(T, Decl(global.ts, 1, 16))
|
||||
>T : Symbol(T, Decl(global.ts, 1, 16))
|
||||
|
||||
return x;
|
||||
>x : Symbol(x, Decl(global.ts, 1, 19))
|
||||
}
|
||||
|
||||
function templateObjectFactory() {
|
||||
>templateObjectFactory : Symbol(templateObjectFactory, Decl(global.ts, 3, 5))
|
||||
|
||||
return id`hello world`;
|
||||
>id : Symbol(id, Decl(global.ts, 0, 13))
|
||||
}
|
||||
let result = templateObjectFactory() === templateObjectFactory();
|
||||
>result : Symbol(result, Decl(global.ts, 8, 7))
|
||||
>templateObjectFactory : Symbol(templateObjectFactory, Decl(global.ts, 3, 5))
|
||||
>templateObjectFactory : Symbol(templateObjectFactory, Decl(global.ts, 3, 5))
|
||||
}
|
||||
=== tests/cases/compiler/module.ts ===
|
||||
export { }
|
||||
function id<T>(x: T): T {
|
||||
>id : Symbol(id, Decl(module.ts, 0, 10))
|
||||
>T : Symbol(T, Decl(module.ts, 1, 12))
|
||||
>x : Symbol(x, Decl(module.ts, 1, 15))
|
||||
>T : Symbol(T, Decl(module.ts, 1, 12))
|
||||
>T : Symbol(T, Decl(module.ts, 1, 12))
|
||||
|
||||
return x;
|
||||
>x : Symbol(x, Decl(module.ts, 1, 15))
|
||||
}
|
||||
|
||||
function templateObjectFactory() {
|
||||
>templateObjectFactory : Symbol(templateObjectFactory, Decl(module.ts, 3, 1))
|
||||
|
||||
return id`hello world`;
|
||||
>id : Symbol(id, Decl(module.ts, 0, 10))
|
||||
}
|
||||
let result = templateObjectFactory() === templateObjectFactory();
|
||||
>result : Symbol(result, Decl(module.ts, 8, 3))
|
||||
>templateObjectFactory : Symbol(templateObjectFactory, Decl(module.ts, 3, 1))
|
||||
>templateObjectFactory : Symbol(templateObjectFactory, Decl(module.ts, 3, 1))
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
=== tests/cases/compiler/global.ts ===
|
||||
namespace n {
|
||||
>n : typeof n
|
||||
|
||||
function id<T>(x: T): T {
|
||||
>id : <T>(x: T) => T
|
||||
>T : T
|
||||
>x : T
|
||||
>T : T
|
||||
>T : T
|
||||
|
||||
return x;
|
||||
>x : T
|
||||
}
|
||||
|
||||
function templateObjectFactory() {
|
||||
>templateObjectFactory : () => TemplateStringsArray
|
||||
|
||||
return id`hello world`;
|
||||
>id`hello world` : TemplateStringsArray
|
||||
>id : <T>(x: T) => T
|
||||
>`hello world` : "hello world"
|
||||
}
|
||||
let result = templateObjectFactory() === templateObjectFactory();
|
||||
>result : boolean
|
||||
>templateObjectFactory() === templateObjectFactory() : boolean
|
||||
>templateObjectFactory() : TemplateStringsArray
|
||||
>templateObjectFactory : () => TemplateStringsArray
|
||||
>templateObjectFactory() : TemplateStringsArray
|
||||
>templateObjectFactory : () => TemplateStringsArray
|
||||
}
|
||||
=== tests/cases/compiler/module.ts ===
|
||||
export { }
|
||||
function id<T>(x: T): T {
|
||||
>id : <T>(x: T) => T
|
||||
>T : T
|
||||
>x : T
|
||||
>T : T
|
||||
>T : T
|
||||
|
||||
return x;
|
||||
>x : T
|
||||
}
|
||||
|
||||
function templateObjectFactory() {
|
||||
>templateObjectFactory : () => TemplateStringsArray
|
||||
|
||||
return id`hello world`;
|
||||
>id`hello world` : TemplateStringsArray
|
||||
>id : <T>(x: T) => T
|
||||
>`hello world` : "hello world"
|
||||
}
|
||||
let result = templateObjectFactory() === templateObjectFactory();
|
||||
>result : boolean
|
||||
>templateObjectFactory() === templateObjectFactory() : boolean
|
||||
>templateObjectFactory() : TemplateStringsArray
|
||||
>templateObjectFactory : () => TemplateStringsArray
|
||||
>templateObjectFactory() : TemplateStringsArray
|
||||
>templateObjectFactory : () => TemplateStringsArray
|
||||
|
||||
Reference in New Issue
Block a user