BuiltInObjectSymbolicValue implements ObjectSymbolicValue { @Override public SymbolicValue getPropertyValue(String propertyName) { BuiltInProperty property = properties.get(propertyName); if (property != null) { return property.access(); } if (prototype != null) { return prototype.getPropertyValue(propertyName); } return SpecialSymbolicValue.UNDEFINED; } BuiltInObjectSymbolicValue(Map<String, BuiltInProperty> properties, @Nullable BuiltInObjectSymbolicValue prototype, Constraint baseConstraint); static BuiltInObjectSymbolicValue create(Map<String, BuiltInProperty> properties, BuiltInObjectSymbolicValue prototype, Constraint baseConstraint); static Optional<SymbolicValue> find(String name); Constraint baseConstraint(); @Override Constraint baseConstraint(ProgramState state); @Override SymbolicValue getPropertyValue(String propertyName); BuiltInObjectSymbolicValue prototype(); static final BuiltInObjectSymbolicValue OBJECT_PROTOTYPE; static final BuiltInObjectSymbolicValue FUNCTION_PROTOTYPE; static final BuiltInObjectSymbolicValue STRING_PROTOTYPE; static final BuiltInObjectSymbolicValue NUMBER_PROTOTYPE; static final BuiltInObjectSymbolicValue BOOLEAN_PROTOTYPE; static final BuiltInObjectSymbolicValue ARRAY_PROTOTYPE; static final BuiltInObjectSymbolicValue DATE_PROTOTYPE; static final BuiltInObjectSymbolicValue REGEXP_PROTOTYPE; static final BuiltInObjectSymbolicValue MATH; static final BuiltInConstructorSymbolicValue OBJECT; static final BuiltInConstructorSymbolicValue FUNCTION; static final BuiltInConstructorSymbolicValue STRING; static final BuiltInConstructorSymbolicValue NUMBER; static final BuiltInConstructorSymbolicValue BOOLEAN; static final BuiltInConstructorSymbolicValue ARRAY; static final BuiltInConstructorSymbolicValue DATE; static final BuiltInConstructorSymbolicValue REGEXP; static final SymbolicValue IS_NAN; }
@Test public void prototype_property() throws Exception { assertThat(BuiltInObjectSymbolicValue.OBJECT.getPropertyValue("prototype")).isEqualTo(BuiltInObjectSymbolicValue.OBJECT_PROTOTYPE); assertThat(BuiltInObjectSymbolicValue.OBJECT_PROTOTYPE.getPropertyValue("prototype")).isEqualTo(SpecialSymbolicValue.UNDEFINED); }