public JSArrayBuffer() : base(new mdr.DObject(), "ArrayBuffer") { JittedCode = (ref mdr.CallFrame callFrame) => { DArrayBuffer buffer; var len = 0; var argsCount = callFrame.PassedArgsCount; if (argsCount > 0) { len = Math.Max(0, callFrame.Arg0.AsInt32()); } buffer = new DArrayBuffer(TargetPrototype, len); if (IsConstrutor) { callFrame.This = (buffer); } else { callFrame.Return.Set(buffer); } }; TargetPrototype.DefineOwnProperty("byteLength", new mdr.DProperty() { OnGetDValue = (mdr.DObject This, ref mdr.DValue v) => { v.Set((This as DArrayBuffer).ByteLength); }, OnSetDValue = (mdr.DObject This, ref mdr.DValue v) => { /* do nothing */ }, OnSetInt = (mdr.DObject This, int v) => { /* do nothing */ }, }); }
public JSArrayBuffer() : base(new mdr.DObject(), "ArrayBuffer") { JittedCode = (ref mdr.CallFrame callFrame) => { DArrayBuffer buffer; var len = 0; var argsCount = callFrame.PassedArgsCount; if (argsCount > 0) len = Math.Max(0, callFrame.Arg0.AsInt32()); buffer = new DArrayBuffer(TargetPrototype, len); if (IsConstrutor) callFrame.This = (buffer); else callFrame.Return.Set(buffer); }; TargetPrototype.DefineOwnProperty("byteLength", new mdr.DProperty() { OnGetDValue = (mdr.DObject This, ref mdr.DValue v) => { v.Set((This as DArrayBuffer).ByteLength); }, OnSetDValue = (mdr.DObject This, ref mdr.DValue v) => { /* do nothing */ }, OnSetInt = (mdr.DObject This, int v) => { /* do nothing */ }, }); }
protected DTypedArray(mdr.DObject prototype, DArrayBuffer array, int byteoffset, int bytelength, int typesize) : base(prototype) { ByteOffset_ = byteoffset; TypeSize_ = typesize; ByteLength_ = bytelength; Elements_ = array.Elements_; }
public DInt16Array(mdr.DObject prototype, DArrayBuffer array, int byteoffset, int bytelength, int typesize) : base(prototype, array, byteoffset, bytelength, typesize) { }
public DFloat32Array(mdr.DObject prototype, DArrayBuffer array, int byteoffset, int bytelength, int typesize) : base(prototype, array, byteoffset, bytelength, typesize) { }