{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/7610","repository_url":"https://api.github.com/repos/Microsoft/TypeScript","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/7610/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/7610/comments","events_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/7610/events","html_url":"https://github.com/Microsoft/TypeScript/issues/7610","id":142287141,"number":7610,"title":"TypeScript transform template string error when in browser with System.js","user":{"login":"Treri","id":2631733,"avatar_url":"https://avatars.githubusercontent.com/u/2631733?v=3","gravatar_id":"","url":"https://api.github.com/users/Treri","html_url":"https://github.com/Treri","followers_url":"https://api.github.com/users/Treri/followers","following_url":"https://api.github.com/users/Treri/following{/other_user}","gists_url":"https://api.github.com/users/Treri/gists{/gist_id}","starred_url":"https://api.github.com/users/Treri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Treri/subscriptions","organizations_url":"https://api.github.com/users/Treri/orgs","repos_url":"https://api.github.com/users/Treri/repos","events_url":"https://api.github.com/users/Treri/events{/privacy}","received_events_url":"https://api.github.com/users/Treri/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-03-21T08:43:47Z","updated_at":"2016-03-21T09:27:36Z","closed_at":null,"body":"**TypeScript Version:** \r\n\r\n1.8.9\r\n\r\nI used TypeScript(1.8.9) and System.js(0.19.24) in browsers.\r\n\r\n**Code**\r\n\r\n```js\r\nexport function prepare(module){\r\n\r\n  let style = module.style;\r\n  let canvas = document.createElement('canvas');\r\n\r\n  canvas.width = parseInt(style.width);\r\n  canvas.height = parseInt(style.height);\r\n\r\n  // canvas.style.width = canvas.width + 'px';\r\n  // canvas.style.height = canvas.height + 'px';\r\n\r\n  canvas.style.width = `${ canvas.width }px`;\r\n  canvas.style.height = `${ canvas.height }px`;\r\n\r\n  module._canvas = canvas;\r\n}\r\n```\r\n\r\n**Expected behavior:**\r\ntransform template string correctly.\r\n\r\n**Actual behavior:** \r\ntransform template string incorrectly. The transformed code have unexpected `}` in template string.\r\n\r\nIf I use the commented normal `width + 'px'`statements, no errors. \r\n\r\nresult code:\r\n```js\r\n(function(System, SystemJS) {(function(__moduleName){System.register([], function(exports_1, context_1) {\r\n    \"use strict\";\r\n    var __moduleName = context_1 && context_1.id;\r\n    function prepare(module) {\r\n        var style = module.style;\r\n        var canvas = document.createElement('canvas');\r\n        canvas.width = parseInt(style.width);\r\n        canvas.height = parseInt(style.height);\r\n        // canvas.style.width = canvas.width + 'px';\r\n        // canvas.style.height = canvas.height + 'px';\r\n        canvas.style.width = canvas.width + }px`;\r\n        canvas.style.height = canvas.height + }px`;\r\n        module._canvas = canvas;\r\n    }\r\n    exports_1(\"prepare\", prepare);\r\n    return {\r\n        setters:[],\r\n        execute: function() {\r\n        }\r\n    }\r\n});\r\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJlcGFyZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbInByZXBhcmUuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0lBQ0EsaUJBQXdCLE1BQU07UUFFNUIsSUFBSSxLQUFLLEdBQUcsTUFBTSxDQUFDLEtBQUssQ0FBQztRQUN6QixJQUFJLE1BQU0sR0FBRyxRQUFRLENBQUMsYUFBYSxDQUFDLFFBQVEsQ0FBQyxDQUFDO1FBRTlDLE1BQU0sQ0FBQyxLQUFLLEdBQUcsUUFBUSxDQUFDLEtBQUssQ0FBQyxLQUFLLENBQUMsQ0FBQztRQUNyQyxNQUFNLENBQUMsTUFBTSxHQUFHLFFBQVEsQ0FBQyxLQUFLLENBQUMsTUFBTSxDQUFDLENBQUM7UUFFdkMsNENBQTRDO1FBQzVDLDhDQUE4QztRQUU5QyxNQUFNLENBQUMsS0FBSyxDQUFDLEtBQUssR0FBTyxNQUFNLENBQUMsS0FBSyxPQUFLLENBQUM7UUFDM0MsTUFBTSxDQUFDLEtBQUssQ0FBQyxNQUFNLEdBQU8sTUFBTSxDQUFDLE1BQU0sT0FBSyxDQUFDO1FBRTdDLE1BQU0sQ0FBQyxPQUFPLEdBQUcsTUFBTSxDQUFDO0lBQzFCLENBQUM7SUFmRCw2QkFlQyxDQUFBIn0=\r\n})(\"http://v:3000/src/utils/prepare.js\");\r\n})(System, System);\r\n```\r\n\r\n**I pushed my repo to [github](https://github.com/Treri/typescript-example). So anyone can reproduce the error.**\r\n\r\nWhen you installed all dependencies, and start server, you can see errors in console. and you can find the transformed error code."},"comment":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/comments/199190906","html_url":"https://github.com/Microsoft/TypeScript/issues/7610#issuecomment-199190906","issue_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/7610","id":199190906,"user":{"login":"Treri","id":2631733,"avatar_url":"https://avatars.githubusercontent.com/u/2631733?v=3","gravatar_id":"","url":"https://api.github.com/users/Treri","html_url":"https://github.com/Treri","followers_url":"https://api.github.com/users/Treri/followers","following_url":"https://api.github.com/users/Treri/following{/other_user}","gists_url":"https://api.github.com/users/Treri/gists{/gist_id}","starred_url":"https://api.github.com/users/Treri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Treri/subscriptions","organizations_url":"https://api.github.com/users/Treri/orgs","repos_url":"https://api.github.com/users/Treri/repos","events_url":"https://api.github.com/users/Treri/events{/privacy}","received_events_url":"https://api.github.com/users/Treri/received_events","type":"User","site_admin":false},"created_at":"2016-03-21T09:27:36Z","updated_at":"2016-03-21T09:27:36Z","body":"Thanks. This works. But some weird."}}