Accepted baselines.

This commit is contained in:
Daniel Rosenwasser 2017-10-13 15:27:16 -07:00
parent 2024ca20f8
commit 70579497c5
6 changed files with 134 additions and 6 deletions

View file

@ -83,8 +83,8 @@ var C = /** @class */ (function () {
function id(x) {
return x;
}
exports.result = id(_a || (_a = tslib_1.__makeTemplateObject(["hello world"], ["hello world"])));
var _a;
exports.result = id(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["hello world"], ["hello world"])));
var templateObject_1;
//// [script.js]
var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||

View file

@ -18,5 +18,5 @@ var tslib_1 = require("tslib");
function id(x) {
return x;
}
exports.result = id(_a || (_a = tslib_1.__makeTemplateObject(["hello world"], ["hello world"])));
var _a;
exports.result = id(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["hello world"], ["hello world"])));
var templateObject_1;

View file

@ -0,0 +1,44 @@
//// [taggedTemplatesInDifferentScopes.ts]
export function tag(parts: TemplateStringsArray, ...values: any[]) {
return parts[0];
}
function foo() {
tag `foo`;
tag `foo2`;
}
function bar() {
tag `bar`;
tag `bar2`;
}
foo();
bar();
//// [taggedTemplatesInDifferentScopes.js]
"use strict";
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
return cooked;
};
exports.__esModule = true;
function tag(parts) {
var values = [];
for (var _i = 1; _i < arguments.length; _i++) {
values[_i - 1] = arguments[_i];
}
return parts[0];
}
exports.tag = tag;
function foo() {
tag(templateObject_1 || (templateObject_1 = __makeTemplateObject(["foo"], ["foo"])));
tag(templateObject_2 || (templateObject_2 = __makeTemplateObject(["foo2"], ["foo2"])));
}
function bar() {
tag(templateObject_3 || (templateObject_3 = __makeTemplateObject(["bar"], ["bar"])));
tag(templateObject_4 || (templateObject_4 = __makeTemplateObject(["bar2"], ["bar2"])));
}
foo();
bar();
var templateObject_1, templateObject_2, templateObject_3, templateObject_4;

View file

@ -0,0 +1,36 @@
=== tests/cases/compiler/taggedTemplatesInDifferentScopes.ts ===
export function tag(parts: TemplateStringsArray, ...values: any[]) {
>tag : Symbol(tag, Decl(taggedTemplatesInDifferentScopes.ts, 0, 0))
>parts : Symbol(parts, Decl(taggedTemplatesInDifferentScopes.ts, 0, 20))
>TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.d.ts, --, --))
>values : Symbol(values, Decl(taggedTemplatesInDifferentScopes.ts, 0, 48))
return parts[0];
>parts : Symbol(parts, Decl(taggedTemplatesInDifferentScopes.ts, 0, 20))
}
function foo() {
>foo : Symbol(foo, Decl(taggedTemplatesInDifferentScopes.ts, 2, 1))
tag `foo`;
>tag : Symbol(tag, Decl(taggedTemplatesInDifferentScopes.ts, 0, 0))
tag `foo2`;
>tag : Symbol(tag, Decl(taggedTemplatesInDifferentScopes.ts, 0, 0))
}
function bar() {
>bar : Symbol(bar, Decl(taggedTemplatesInDifferentScopes.ts, 6, 1))
tag `bar`;
>tag : Symbol(tag, Decl(taggedTemplatesInDifferentScopes.ts, 0, 0))
tag `bar2`;
>tag : Symbol(tag, Decl(taggedTemplatesInDifferentScopes.ts, 0, 0))
}
foo();
>foo : Symbol(foo, Decl(taggedTemplatesInDifferentScopes.ts, 2, 1))
bar();
>bar : Symbol(bar, Decl(taggedTemplatesInDifferentScopes.ts, 6, 1))

View file

@ -0,0 +1,48 @@
=== tests/cases/compiler/taggedTemplatesInDifferentScopes.ts ===
export function tag(parts: TemplateStringsArray, ...values: any[]) {
>tag : (parts: TemplateStringsArray, ...values: any[]) => string
>parts : TemplateStringsArray
>TemplateStringsArray : TemplateStringsArray
>values : any[]
return parts[0];
>parts[0] : string
>parts : TemplateStringsArray
>0 : 0
}
function foo() {
>foo : () => void
tag `foo`;
>tag `foo` : string
>tag : (parts: TemplateStringsArray, ...values: any[]) => string
>`foo` : "foo"
tag `foo2`;
>tag `foo2` : string
>tag : (parts: TemplateStringsArray, ...values: any[]) => string
>`foo2` : "foo2"
}
function bar() {
>bar : () => void
tag `bar`;
>tag `bar` : string
>tag : (parts: TemplateStringsArray, ...values: any[]) => string
>`bar` : "bar"
tag `bar2`;
>tag `bar2` : string
>tag : (parts: TemplateStringsArray, ...values: any[]) => string
>`bar2` : "bar2"
}
foo();
>foo() : void
>foo : () => void
bar();
>bar() : void
>bar : () => void

View file

@ -49,7 +49,7 @@ function id(x) {
return x;
}
function templateObjectFactory() {
return id(_a || (_a = __makeTemplateObject(["hello world"], ["hello world"])));
return id(templateObject_1 || (templateObject_1 = __makeTemplateObject(["hello world"], ["hello world"])));
}
var result = templateObjectFactory() === templateObjectFactory();
var _a;
var templateObject_1;