[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:
parent
13242e333e
commit
e000fa3609
@ -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]);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user