Skip to content

hoisted declarations still added before prologue directives #24582

@ajafff

Description

@ajafff

TypeScript Version: 2.9.1 and 3.0.0-dev.20180601

Search Terms:

Code

function test(p: any) {
    'use strict';
    p = { prop: p } = p;
}

Expected behavior:

function test(p) {
    'use strict';
    var _a;
    p = (_a = p, p = _a.prop, _a);
}

Actual behavior:

function test(p) {
    var _a;
    'use strict';
    p = (_a = p, p = _a.prop, _a);
}

Playground Link: http://www.typescriptlang.org/play/#src=function%20test(p%3A%20any)%20%7B%0A%20%20%20%20'use%20strict'%3B%0A%20%20%20%20p%20%3D%20%7B%20prop%3A%20p%20%7D%20%3D%20p%3B%0A%7D

Related Issues:
#24386 should have fixed this 😕 but the baselines only changed code related to System.register. //cc @weswigham

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptFixedA PR has been merged for this issue

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions