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

Spec violation? #21106

Closed
ghost opened this issue Jun 3, 2018 · 4 comments
Closed

Spec violation? #21106

ghost opened this issue Jun 3, 2018 · 4 comments
Labels
v8 engine Issues and PRs related to the V8 dependency.

Comments

@ghost
Copy link

ghost commented Jun 3, 2018

  • Version: 10.3.0
  • Platform: windows 10
  • Subsystem: v8

Shouldn't this

(a=>a``==a``)(a=>a)

evaluate to true according to the ES specification? I found this yesterday on Firefox (gecko) bug tracker, but I can't find the issue right now. It seems that Node.js has the same issue. I also read the spec and IIUC it seems like this snippet should evaluate to true but I'm not sure.

Any opinions?

@vsemozhetbyt
Copy link
Contributor

vsemozhetbyt commented Jun 3, 2018

Tagged template functions (a`` here) get an array of strings as the first argument. In your case, a=>a function just returns this array. So your code is equivalent of [ '' ] == [ '' ] wich is false due to two separate (though similar) objects comparison.

@Trott Trott closed this as completed Jun 3, 2018
@ghost
Copy link
Author

ghost commented Jun 3, 2018

@vsemozhetbyt

No, my point is that it should indeed be the same reference to the same array. See this: https://www.ecma-international.org/ecma-262/8.0/index.html#sec-gettemplateobject

Paragraph 4:

I tested on Chrome 63 and it logs true, so I suppose it is a regression in v8.

@Trott PTAL

@vsemozhetbyt
Copy link
Contributor

cc @nodejs/v8

@targos targos reopened this Jun 3, 2018
@bnoordhuis
Copy link
Member

This was also reported over at https://bugs.chromium.org/p/v8/issues/detail?id=7801. Since this is a V8 issue and it doesn't look like V8 will change behavior right now, I'll go ahead and close this out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v8 engine Issues and PRs related to the V8 dependency.
Projects
None yet
Development

No branches or pull requests

4 participants