Status: New
Owner: ----

New issue 3140 by [email protected]: Identifier reference resolution in compound assignment and increment/decrement operator incorrect
http://code.google.com/p/v8/issues/detail?id=3140

See https://bugs.ecmascript.org/show_bug.cgi?id=1751, https://mail.mozilla.org/pipermail/es-discuss/2014-January/035642.html .

11.13.2 Compound Assignment does a single reference resolution for its LHS. This also applies to the increment and decrement operators
(11.3.1, 11.3.2, 11.4.4, 11.4.5).

v8 bleeding edge, rev 19151

Test case 1:
---
var o1, o2;
with (o1 = {set x(v) { print("wrong") }}) {
  with (o2 = {get x() { delete this.x; return 2 }}) {
    x += 1;
  }
}
o2.x
---

Expected: "wrong" is not printed and `o2.x` is set to 3
Actual: "wrong" is printed


Test case 2:
---
var x = 1;
(function() {
  x += eval("var x = 2; x");
  return x;
})();
---

Expected: function returns 2 and global x is set to 3
Actual: function returns 3


Test case 3:
---
(function(global) {
  "use strict";
  Object.defineProperty(global, "x", {configurable:true, get: function(){
delete this.x; return 2 }});
  x += 1;
})(this);
---

Expected: Create a global variable x with value 3, no strict-mode ReferenceError is thrown
Actual: ReferenceError is thrown

--
You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to