Skip to content

Commit 45e09c7

Browse files
committed
Property assumptions on null shape are trivially always true.
1 parent 38ec350 commit 45e09c7

File tree

1 file changed

+5
-2
lines changed
  • graal-js/src/com.oracle.truffle.js/src/com/oracle/truffle/js/runtime/objects

1 file changed

+5
-2
lines changed

graal-js/src/com.oracle.truffle.js/src/com/oracle/truffle/js/runtime/objects/JSShape.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* The Universal Permissive License (UPL), Version 1.0
@@ -178,7 +178,10 @@ public static Assumption getPropertyAssumption(Shape shape, Object key) {
178178
}
179179

180180
public static Assumption getPropertyAssumption(Shape shape, Object key, boolean prototype) {
181-
assert JSRuntime.isPropertyKey(key) || key instanceof HiddenKey;
181+
assert JSRuntime.isPropertyKey(key) || key instanceof HiddenKey : key;
182+
if (shape == Null.SHAPE) {
183+
return Assumption.ALWAYS_VALID;
184+
}
182185
if (prototype && JSConfig.LeafShapeAssumption) {
183186
return shape.getLeafAssumption();
184187
}

0 commit comments

Comments
 (0)