Commit c35c40ae authored by Camillo Bruni's avatar Camillo Bruni Committed by Commit Bot

[literals] Document that literals with simple getters cause dict-properties

Drive-by-fix: increase coverage in object literals test.

Change-Id: Iccfdf35b29229f63b3e8c1d961bee56ee03da688
Reviewed-on: https://chromium-review.googlesource.com/751661Reviewed-by: 's avatarToon Verwaest <verwaest@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#49105}
parent eee9fcbc
// Copyright 2017 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
(function TestModifedPrototypeInObjectLiteral() {
// The prototype chain should not be used if the definition
// happens in the object literal.
Object.defineProperty(Object.prototype, 'c', {
get: function () {
return 21;
},
set: function () {
}
});
var o = {};
o.c = 7;
assertEquals(21, o.c);
var l = {c: 7};
assertEquals(7, l.c);
delete Object.prototype.c;
})();
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment