Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.dynjs.runtime.builtins.types.object;
 
public class IsFrozen extends AbstractNativeFunction {
    public IsFrozen(GlobalObject globalObject) {
        super(globalObject"o");
    }
    @Override
    public Object call(ExecutionContext contextObject selfObject... args) {
        // 15.2.3.12
        Object o = args[0];
        if (!(o instanceof JSObject)) {
            throw new ThrowException(contextcontext.createTypeError("must be an object"));
        }
        JSObject jsObj = (JSObjecto;
        NameEnumerator names = jsObj.getOwnPropertyNames();
        while (names.hasNext()) {
            String name = names.next();
            Object d = jsObj.getOwnProperty(contextname);
            if (d != .) {
                PropertyDescriptor desc = (PropertyDescriptord;
                if (desc.isDataDescriptor()) {
                    Object isWritable = desc.get("Writable");
                    if (isWritable == .) {
                        return false;
                    }
                }
                Object isConfigurable = desc.get("Configurable");
                if (isConfigurable == .) {
                    return false;
                }
            }
        }
        if (!jsObj.isExtensible()) {
            return true;
        }
        return false;
    }
New to GrepCode? Check out our FAQ X