We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 633a626 commit 8a649a3Copy full SHA for 8a649a3
test/com/google/javascript/jscomp/TypeInferenceTest.java
@@ -3834,6 +3834,11 @@ public void testObjectLiteralNoSideEffect() {
3834
assertWithMessage("Type inference must not alter OBJECT_TYPE.")
3835
.that(registry.getNativeObjectType(JSTypeNative.OBJECT_TYPE).hasOwnProperty("data"))
3836
.isFalse();
3837
+ // Check that the inferred type of 'obj' has a property 'data' associated with it.
3838
+ assertWithMessage("Cannot resolve type of 'obj'").that(getType("obj")).isNotNull();
3839
+ assertWithMessage("Expect property 'data' to be defined on 'obj'")
3840
+ .that(registry.canPropertyBeDefined(getType("obj"), "data"))
3841
+ .isNotEqualTo(JSTypeRegistry.PropDefinitionKind.UNKNOWN);
3842
}
3843
3844
@Test
0 commit comments