Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1720)

Unified Diff: test/mjsunit/harmony/object-literals-property-shorthand.js

Issue 858673002: Fix issue with __proto__ when using ES6 object literals (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: git rebase Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: test/mjsunit/harmony/object-literals-property-shorthand.js
diff --git a/test/mjsunit/harmony/object-literals-property-shorthand.js b/test/mjsunit/harmony/object-literals-property-shorthand.js
index 2921495d892fba40e7f111fa0250b50777a75849..9756da46c10b4309f61cbba94c0dea6c63e4832c 100644
--- a/test/mjsunit/harmony/object-literals-property-shorthand.js
+++ b/test/mjsunit/harmony/object-literals-property-shorthand.js
@@ -49,3 +49,25 @@
function f(x) { return {x}; }
assertEquals('function f(x) { return {x}; }', f.toString());
})();
+
+
+(function TestProtoName() {
+ var __proto__ = 1;
+ var object = {
+ __proto__
+ };
+ assertEquals(Object.prototype, Object.getPrototypeOf(object));
+ assertEquals(1, object.__proto__);
+})();
+
+
+(function TestProtoName2() {
+ var __proto__ = 1;
+ var p = {};
+ var object = {
+ __proto__: p,
+ __proto__,
+ };
+ assertEquals(p, Object.getPrototypeOf(object));
+ assertEquals(1, object.__proto__);
+})();
« no previous file with comments | « test/mjsunit/harmony/object-literals-method.js ('k') | test/mjsunit/object-literal-multiple-proto-fields.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698