/// <summary> /// WARNING: Make sure this object is already rooted! /// </summary> /// <param name="o"></param> public Value(JSObjectPtr o) { this = default(Value); if (o.IsZero) { tag = JSValueTag.NULL; } else { tag = JSValueTag.OBJECT; } packed.obj = o; }
public Value(double d) { this = default(Value); tag = JSValueTag.DOUBLE; packed.f64 = d; }
/* * js::gc::Cell *cell; * JSWhyMagic why; * size_t word; * } s; * void *asPtr; */ public Value(bool b) { this = default(Value); tag = JSValueTag.BOOLEAN; packed.i32 = b ? 1 : 0; }
public Value(int i) { this = default(Value); tag = JSValueTag.INT32; packed.i32 = i; }
/// <summary> /// WARNING: Make sure this string is already rooted! /// </summary> /// <param name="s"></param> public Value(JSStringPtr s) { this = default(Value); tag = JSValueTag.STRING; packed.str = s; }