From f94bdedc79a0aa386c28c8b5eac26b52b826cec1 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Fri, 29 Sep 2017 23:01:33 -0700 Subject: [PATCH] Added test for module & global examples. --- .../taggedTemplatesInModuleAndGlobal.ts | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 tests/cases/compiler/taggedTemplatesInModuleAndGlobal.ts diff --git a/tests/cases/compiler/taggedTemplatesInModuleAndGlobal.ts b/tests/cases/compiler/taggedTemplatesInModuleAndGlobal.ts new file mode 100644 index 00000000000..b96b869704a --- /dev/null +++ b/tests/cases/compiler/taggedTemplatesInModuleAndGlobal.ts @@ -0,0 +1,24 @@ +// @module: commonjs +// @target: es5 + +// @filename: global.ts +namespace n { + function id(x: T): T { + return x; + } + + function templateObjectFactory() { + return id`hello world`; + } + let result = templateObjectFactory() === templateObjectFactory(); +} +// @filename: module.ts +export { } +function id(x: T): T { + return x; +} + +function templateObjectFactory() { + return id`hello world`; +} +let result = templateObjectFactory() === templateObjectFactory();