Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Emit] Functions in object literals #40

Closed
mhegazy opened this issue Jul 17, 2014 · 2 comments
Closed

[Emit] Functions in object literals #40

mhegazy opened this issue Jul 17, 2014 · 2 comments
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue

Comments

@mhegazy
Copy link
Contributor

mhegazy commented Jul 17, 2014

var x = { f() { return 1; } }
var y = { f: () => { return 1; } }
var z = { f: function() { return 1; } }

Expected:

var x = { f: function () {        return 1;    } };
var y = { f: function () {        return 1;    } };
var z = { f: function () {        return 1;    } };

Actual:

var x = { f: function f() {    return 1;} };
var y = { f: function () {    return 1;} };
var z = { f: function () {    return 1;} };

This would be a breaking change, but might align with ES6?

@mhegazy mhegazy added this to the TypeScript 1.1 milestone Jul 17, 2014
@sophiajt
Copy link
Contributor

From looking at the traceur output, and from my reading of the ES6 spec, it looks like f should not be visible. The expected is correct:

var x = { f: function () {
        return 1;
} };

@vladima
Copy link
Contributor

vladima commented Jul 17, 2014

should be fixed by 42183cf

@vladima vladima closed this as completed Jul 17, 2014
@vladima vladima removed the Fixed label Aug 5, 2014
@microsoft microsoft locked and limited conversation to collaborators Jun 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue
Projects
None yet
Development

No branches or pull requests

3 participants