use of com.github.anba.es6draft.runtime.types.Property in project es6draft by anba.
the class ArgumentsObject method CreateUnmappedArgumentsObject.
/**
* 9.4.4.6 CreateUnmappedArgumentsObject(argumentsList)
* <p>
* [Called from generated code]
*
* @param cx
* the execution context
* @param argumentsList
* the function arguments
* @return the strict mode arguments object
*/
public static ArgumentsObject CreateUnmappedArgumentsObject(ExecutionContext cx, Object[] argumentsList) {
/* step 1 */
int len = argumentsList.length;
/* steps 2-3 */
ArgumentsObject obj = new ArgumentsObject(cx.getRealm(), null);
/* step 4 */
obj.infallibleDefineOwnProperty("length", new Property(len, true, false, true));
/* steps 5-6 */
for (int index = 0; index < len; ++index) {
obj.setIndexed(index, argumentsList[index]);
}
Callable thrower = cx.getRealm().getThrowTypeError();
/* step 7 */
obj.infallibleDefineOwnProperty(BuiltinSymbol.iterator.get(), new Property(cx.getIntrinsic(Intrinsics.ArrayProto_values), true, false, true));
/* step 8 */
obj.infallibleDefineOwnProperty("callee", new Property(thrower, thrower, false, false));
/* step 9 */
return obj;
}
use of com.github.anba.es6draft.runtime.types.Property in project es6draft by anba.
the class BuiltinFunction method reifyDefaultProperties.
private void reifyDefaultProperties() {
assert hasDefaultName || hasDefaultLength;
// This is a bit kludgy, but necessary to ensure the property order is spec-compliant. Alternatively we could
// store the default 'name' and 'length' properties as Property objects.
defineOwnPropertiesUncheckedAtFront(p -> {
if (hasDefaultLength) {
p.accept("length", new Property(arity, false, false, true));
}
if (hasDefaultName) {
p.accept("name", new Property(name, false, false, true));
}
});
hasDefaultName = false;
hasDefaultLength = false;
}
use of com.github.anba.es6draft.runtime.types.Property in project es6draft by anba.
the class ZoneConstructor method initialize.
@Override
public void initialize(Realm realm) {
createProperties(realm, this, Properties.class);
ZoneObject initialZone = new ZoneObject(realm, null, realm.getIntrinsic(Intrinsics.ZonePrototype));
initialZone.infallibleDefineOwnProperty("name", new Property("(root zone)", false, false, true));
realm.setCurrentZone(initialZone);
}
Aggregations