TypeScript Version: 3.0.0-dev.20180605
Search Terms:
Code
// this is obviously a bogus function just to have a minimal repro
function test(p: any) {
'use strong';
'use strict';
p = {prop: p} = p;
}
Expected behavior:
function test(p) {
'use strong';
'use strict';
var _a;
p = (_a = p, p = _a.prop, _a);
}
Actual behavior:
function test(p) {
'use strong';
var _a;
'use strict';
p = (_a = p, p = _a.prop, _a);
}
The transpiled code has different semantics, because 'use strict' is no longer treated as directive.
I don't know if this also affects other transformers that add statements.
Note that TypeScript correctly detects the 'use strict' directive and would correctly complain about octal literals.
Playground Link:
Related Issues:
#24582
#24386 (comment)
TypeScript Version: 3.0.0-dev.20180605
Search Terms:
Code
Expected behavior:
Actual behavior:
The transpiled code has different semantics, because
'use strict'is no longer treated as directive.I don't know if this also affects other transformers that add statements.
Note that TypeScript correctly detects the
'use strict'directive and would correctly complain about octal literals.Playground Link:
Related Issues:
#24582
#24386 (comment)