[cctest] Clarify OverrideReadOnlyPropertyOnPrototype setup

The `readonly: true` key-value pair is redundant since it gets
ignored anyhow. This patch removes it.

Also, `configurable: false` is implied when
using `Object.defineProperty` (just like `enumerable: false`
and `writable: false`). Therefore, specifying only `configurable`
but not `enumerable` and `writable` gave the impression that
configurability was somehow the deciding factor for this test.
Instead, the only important data property for this test is
`writable: false`. This patch lists all four data property
attributes explicitly, making it clear that only `writable` has
a “special” value.

Bug: v8:8175, v8:8238
Change-Id: Icfc6262f246712a64cdfcffff7b648f5681a711e
Reviewed-on: https://chromium-review.googlesource.com/c/1357048
Reviewed-by: Caitlin Potter <caitp@igalia.com>
Commit-Queue: Mathias Bynens <mathias@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57986}
This commit is contained in:
Mathias Bynens 2018-12-01 06:20:56 +01:00 committed by Commit Bot
parent 13242e333e
commit e000fa3609

View File

@ -93,7 +93,8 @@ TEST(OverrideReadOnlyPropertyOnPrototype) {
// Initial setup
CompileRun(
"Object.defineProperty(Object.prototype, 'readonly', "
"{ readonly: true, value: 'readonly', configurable: false });");
"{ enumerable: true, configurable: true, writable: false, "
" value: 'readonly' });");
CHECK_EQ(0, use_counts[Isolate::kAttemptOverrideReadOnlyOnPrototypeSloppy]);
CHECK_EQ(0, use_counts[Isolate::kAttemptOverrideReadOnlyOnPrototypeStrict]);