JS: introduce CallToObjectDefineProperty::getAPropertyAttribute

This commit is contained in:
Esben Sparre Andreasen
2019-03-11 09:35:35 +01:00
parent ff5b85067a
commit bd7eef08e8
6 changed files with 30 additions and 12 deletions

View File

@@ -157,6 +157,11 @@ where
or
// exclude result from accessor declarations
assign1.getWriteNode() instanceof AccessorMethodDeclaration
) and
// exclude results from non-value definitions from `Object.defineProperty`
(
assign1 instanceof CallToObjectDefineProperty implies
assign1.(CallToObjectDefineProperty).getAPropertyAttribute().getPropertyName() = "value"
)
select assign1.getWriteNode(),
"This write to property '" + name + "' is useless, since $@ always overrides it.",