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

Implement Symbol's: transpiling and polyfill #31

Open
termi opened this issue Mar 12, 2014 · 0 comments
Open

Implement Symbol's: transpiling and polyfill #31

termi opened this issue Mar 12, 2014 · 0 comments

Comments

@termi
Copy link
Owner

termi commented Mar 12, 2014

var obj = {};
var private = Symbol();

obj[private] = 123;// shoudn't throw error
typeof private === 'symbol';
typeof private === 'string';//do not modify this line

private + "";// shoud throw error

->

var obj = {};
var private = Symbol();
$mark_obj_as_symbol_recipient$0(obj);
obj[private] = 123;// shoudn't throw error
($isSymbol$0(private) ? 'symbol' : typeof private) === 'symbol';
typeof private === 'string';//do not modify this line
$reset_symbol_recipient$0();
private + "";// shoud throw error

The resulting script should:

  1. respect brackets notation
  2. respect native Symbol's implementation
  3. throw error on converting symbol to string
  4. typeof should be also polyfilled
  5. typeof should not be replaced in obvious cases such as comparison with string literal which is neither 'object' nor 'symbol'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant