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

Because the shorthand getter syntax "get <property name>(){...}" isn't supported in Safari 5.x, I'd like to replace it with Object.defineProperty(...) #2131

Open
stuartZhang opened this issue Jul 28, 2016 · 1 comment

Comments

@stuartZhang
Copy link

By scanning the generated ES5 code, I discovered that the getter methods follow the format:

{
get {return ***;}
}

The above getter and setter syntax is good for most of the modern web browsers. However, I'd like to run the generated ES5 code in the Safari 5.x which doesn't sustain the getter shorthand syntax. On the contrary, "Object.defineProperties(...)" is supported utterly.

Object.defineProperties(, {
: {
enumerable: true,
'get': function(){return ***;}
}
})

So, I intend to modify the Traceur source code to replace the shorthand syntax with the integral version based on Object.defineProperties(...).

My 1st goal is the getter counterpart serving the ES6 export commands.

Could you please teach me which Traceur source-code file is most relevant to my 1st goal?

@arv
Copy link
Collaborator

arv commented Jul 29, 2016

https://github.com/google/traceur-compiler/blob/master/src/codegeneration/ObjectLiteralTransformer.js is most likely the transformer that would have most in common with this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants