Constant mujs::JS_READONLY []

pub const JS_READONLY: PropertyAttributes = PropertyAttributes{bits: 1,}

Read only property attribute

Examples

use mujs;

let state = mujs::State::new(mujs::JS_STRICT);

state.newobject();
state.pushnumber(32.0);
state.setproperty(-2, "age");
state.defglobal("me", mujs::JS_READONLY);

The above example defines an object in global space named me, which can not be assigned another object due to the read only flag.