@glimmer/debug
Advanced tools
Comparing version 0.88.1 to 0.89.0
@@ -110,2 +110,3 @@ import { Dict, Maybe, RuntimeOp, TemplateCompilationContext, Nullable, PresentArray, VmMachineOp, VmOp, BlockSymbolTable, ProgramSymbolTable, SimpleDocumentFragment, SimpleElement, SimpleNode } from "@glimmer/interfaces"; | ||
declare const CheckNull: Checker<null>; | ||
declare const CheckUndefined: Checker<undefined>; | ||
declare const CheckUnknown: Checker<unknown>; | ||
@@ -121,3 +122,3 @@ declare const CheckSafeString: Checker<SafeString>; | ||
declare const CheckNode: Checker<SimpleNode>; | ||
export { debug, debugSlice, logOpcode, OPERAND_TYPES, OperandType, Operand, OperandList, NormalizedMetadata, Stack, RawOperandMetadata, OperandName, RawOperandFormat, normalize, NormalizedOpcodes, normalizeAll, normalizeParsed, buildEnum, strip, META_KIND, buildSingleMeta, buildMetas, opcodeMetadata, Checker, wrap, Constructor, Primitive, SafeString, CheckInstanceof, CheckOption, CheckMaybe, CheckInterface, CheckArray, CheckDict, check, recordStackSize, expectStackChange, CheckPrimitive, CheckFunction, CheckNumber, CheckBoolean, CheckHandle, CheckString, CheckNull, CheckUnknown, CheckSafeString, CheckObject, CheckOr, CheckValue, CheckBlockSymbolTable, CheckProgramSymbolTable, CheckElement, CheckDocumentFragment, CheckNode }; | ||
export { debug, debugSlice, logOpcode, OPERAND_TYPES, OperandType, Operand, OperandList, NormalizedMetadata, Stack, RawOperandMetadata, OperandName, RawOperandFormat, normalize, NormalizedOpcodes, normalizeAll, normalizeParsed, buildEnum, strip, META_KIND, buildSingleMeta, buildMetas, opcodeMetadata, Checker, wrap, Constructor, Primitive, SafeString, CheckInstanceof, CheckOption, CheckMaybe, CheckInterface, CheckArray, CheckDict, check, recordStackSize, expectStackChange, CheckPrimitive, CheckFunction, CheckNumber, CheckBoolean, CheckHandle, CheckString, CheckNull, CheckUndefined, CheckUnknown, CheckSafeString, CheckObject, CheckOr, CheckValue, CheckBlockSymbolTable, CheckProgramSymbolTable, CheckElement, CheckDocumentFragment, CheckNode }; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -1303,2 +1303,10 @@ import '@glimmer/util'; | ||
} | ||
class UndefinedChecker { | ||
validate(value) { | ||
return value === undefined; | ||
} | ||
expected() { | ||
return `undefined`; | ||
} | ||
} | ||
class InstanceofChecker { | ||
@@ -1487,2 +1495,3 @@ constructor(Class) { | ||
const CheckNull = new NullChecker(); | ||
const CheckUndefined = new UndefinedChecker(); | ||
const CheckUnknown = new OpaqueChecker(); | ||
@@ -1518,3 +1527,3 @@ const CheckSafeString = new SafeStringChecker(); | ||
export { CheckArray, CheckBlockSymbolTable, CheckBoolean, CheckDict, CheckDocumentFragment, CheckElement, CheckFunction, CheckHandle, CheckInstanceof, CheckInterface, CheckMaybe, CheckNode, CheckNull, CheckNumber, CheckObject, CheckOption, CheckOr, CheckPrimitive, CheckProgramSymbolTable, CheckSafeString, CheckString, CheckUnknown, CheckValue, META_KIND, OPERAND_TYPES, buildEnum, buildMetas, buildSingleMeta, check, debug, debugSlice, expectStackChange, logOpcode, normalize, normalizeAll, normalizeParsed, opcodeMetadata, recordStackSize, strip, wrap }; | ||
export { CheckArray, CheckBlockSymbolTable, CheckBoolean, CheckDict, CheckDocumentFragment, CheckElement, CheckFunction, CheckHandle, CheckInstanceof, CheckInterface, CheckMaybe, CheckNode, CheckNull, CheckNumber, CheckObject, CheckOption, CheckOr, CheckPrimitive, CheckProgramSymbolTable, CheckSafeString, CheckString, CheckUndefined, CheckUnknown, CheckValue, META_KIND, OPERAND_TYPES, buildEnum, buildMetas, buildSingleMeta, check, debug, debugSlice, expectStackChange, logOpcode, normalize, normalizeAll, normalizeParsed, opcodeMetadata, recordStackSize, strip, wrap }; | ||
//# sourceMappingURL=index.js.map |
@@ -110,2 +110,3 @@ import { Dict, Maybe, RuntimeOp, TemplateCompilationContext, Nullable, PresentArray, VmMachineOp, VmOp, BlockSymbolTable, ProgramSymbolTable, SimpleDocumentFragment, SimpleElement, SimpleNode } from "@glimmer/interfaces"; | ||
declare const CheckNull: Checker<null>; | ||
declare const CheckUndefined: Checker<undefined>; | ||
declare const CheckUnknown: Checker<unknown>; | ||
@@ -121,3 +122,3 @@ declare const CheckSafeString: Checker<SafeString>; | ||
declare const CheckNode: Checker<SimpleNode>; | ||
export { debug, debugSlice, logOpcode, OPERAND_TYPES, OperandType, Operand, OperandList, NormalizedMetadata, Stack, RawOperandMetadata, OperandName, RawOperandFormat, normalize, NormalizedOpcodes, normalizeAll, normalizeParsed, buildEnum, strip, META_KIND, buildSingleMeta, buildMetas, opcodeMetadata, Checker, wrap, Constructor, Primitive, SafeString, CheckInstanceof, CheckOption, CheckMaybe, CheckInterface, CheckArray, CheckDict, check, recordStackSize, expectStackChange, CheckPrimitive, CheckFunction, CheckNumber, CheckBoolean, CheckHandle, CheckString, CheckNull, CheckUnknown, CheckSafeString, CheckObject, CheckOr, CheckValue, CheckBlockSymbolTable, CheckProgramSymbolTable, CheckElement, CheckDocumentFragment, CheckNode }; | ||
export { debug, debugSlice, logOpcode, OPERAND_TYPES, OperandType, Operand, OperandList, NormalizedMetadata, Stack, RawOperandMetadata, OperandName, RawOperandFormat, normalize, NormalizedOpcodes, normalizeAll, normalizeParsed, buildEnum, strip, META_KIND, buildSingleMeta, buildMetas, opcodeMetadata, Checker, wrap, Constructor, Primitive, SafeString, CheckInstanceof, CheckOption, CheckMaybe, CheckInterface, CheckArray, CheckDict, check, recordStackSize, expectStackChange, CheckPrimitive, CheckFunction, CheckNumber, CheckBoolean, CheckHandle, CheckString, CheckNull, CheckUndefined, CheckUnknown, CheckSafeString, CheckObject, CheckOr, CheckValue, CheckBlockSymbolTable, CheckProgramSymbolTable, CheckElement, CheckDocumentFragment, CheckNode }; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -9,3 +9,3 @@ import{LOCAL_LOGGER as e,enumerate as n,decodeHandle as t,decodeImmediate as a}from"@glimmer/util";import{Op as o,MachineOp as r,$v0 as c,$t1 as s,$t0 as p,$s1 as m,$s0 as l,$sp as i,$fp as u,$ra as h,$pc as d}from"@glimmer/vm";const f=!("undefined"==typeof window||!window.location||!/[&?]enable_local_should_log/u.test(window.location.search));function k(e,n){return(n?g[e]:y[e])||null}const y=new Array(o.Size).fill(null),g=new Array(o.Size).fill(null);function b(n,t,a){if(f){e.group(`%c${t}:${a}`,"color: #999");let o=n.program.heap,r=n.program.createOp(o),c=0;for(let o=t;o<a;o+=c){r.offset=o;let[t,a]=v(n.program.constants,r,r.isMachine);e.log(`${o}. ${C(t,a)}`),c=r.size}r.offset=-c,e.groupEnd()}}function C(e,n){if(f){let t=e;if(n){let e=Object.keys(n).map((e=>` ${e}=${function(e){if(f){if("function"==typeof e)return"<function>";let n;try{n=JSON.stringify(e)}catch(e){return"<object>"}if(void 0===n)return"undefined";let t=JSON.parse(n);return"object"==typeof t&&null!==t&&void 0!==t.GlimmerDebug?t.GlimmerDebug:n}}(n[e])}`)).join("");t+=e}return`(${t})`}}function v(e,t,a){if(f){let o=k(t.type,a);if(!o)throw new Error(`Missing Opcode Metadata for ${t}`);let r=Object.create(null);for(const[a,c]of n(o.ops)){let n=S(t,a);switch(c.type){case"u32":case"i32":case"owner":r[c.name]=n;break;case"handle":case"str":case"option-str":case"array":case"unknown":r[c.name]=e.getValue(n);break;case"str-array":r[c.name]=e.getArray(n);break;case"bool":r[c.name]=!!n;break;case"primitive":r[c.name]=w(n,e);break;case"register":r[c.name]=A(n);break;case"symbol-table":case"scope":r[c.name]=`<scope ${n}>`;break;default:throw new Error(`Unexpected operand type ${c.type} for debug output`)}}return[o.name,r]}}function S(e,n){switch(n){case 0:return e.op1;case 1:return e.op2;case 2:return e.op3;default:throw new Error("Unexpected operand index (must be 0-2)")}}function A(e){switch(e){case d:return"pc";case h:return"ra";case u:return"fp";case i:return"sp";case l:return"s0";case m:return"s1";case p:return"t0";case s:return"t1";case c:return"v0"}}function w(e,n){return e>=0?n.getValue(t(e)):a(e)}g[r.PushFrame]={name:"PushFrame",mnemonic:"pushf",before:null,stackChange:2,ops:[],operands:0,check:!0},g[r.PopFrame]={name:"PopFrame",mnemonic:"popf",before:null,stackChange:-2,ops:[],operands:0,check:!1},g[r.InvokeVirtual]={name:"InvokeVirtual",mnemonic:"vcall",before:null,stackChange:-1,ops:[],operands:0,check:!0},g[r.InvokeStatic]={name:"InvokeStatic",mnemonic:"scall",before:null,stackChange:0,ops:[{name:"offset",type:"u32"}],operands:1,check:!0},g[r.Jump]={name:"Jump",mnemonic:"goto",before:null,stackChange:0,ops:[{name:"to",type:"u32"}],operands:1,check:!0},g[r.Return]={name:"Return",mnemonic:"ret",before:null,stackChange:0,ops:[],operands:0,check:!1},g[r.ReturnTo]={name:"ReturnTo",mnemonic:"setra",before:null,stackChange:0,ops:[{name:"offset",type:"i32"}],operands:1,check:!0},y[o.Helper]={name:"Helper",mnemonic:"ncall",before:null,stackChange:null,ops:[{name:"helper",type:"handle"}],operands:1,check:!0},y[o.DynamicHelper]={name:"DynamicHelper",mnemonic:"dynamiccall",before:null,stackChange:null,ops:[],operands:0,check:!0},y[o.SetNamedVariables]={name:"SetNamedVariables",mnemonic:"vsargs",before:null,stackChange:0,ops:[{name:"register",type:"u32"}],operands:1,check:!0},y[o.SetBlocks]={name:"SetBlocks",mnemonic:"vbblocks",before:null,stackChange:0,ops:[{name:"register",type:"u32"}],operands:1,check:!0},y[o.SetVariable]={name:"SetVariable",mnemonic:"sbvar",before:null,stackChange:-1,ops:[{name:"symbol",type:"u32"}],operands:1,check:!0},y[o.SetBlock]={name:"SetBlock",mnemonic:"sblock",before:null,stackChange:-3,ops:[{name:"symbol",type:"u32"}],operands:1,check:!0},y[o.GetVariable]={name:"GetVariable",mnemonic:"symload",before:null,stackChange:1,ops:[{name:"symbol",type:"u32"}],operands:1,check:!0},y[o.GetProperty]={name:"GetProperty",mnemonic:"getprop",before:null,stackChange:0,ops:[{name:"property",type:"str"}],operands:1,check:!0},y[o.GetBlock]={name:"GetBlock",mnemonic:"blockload",before:null,stackChange:1,ops:[{name:"block",type:"u32"}],operands:1,check:!0},y[o.SpreadBlock]={name:"SpreadBlock",mnemonic:"blockspread",before:null,stackChange:2,ops:[],operands:0,check:!0},y[o.HasBlock]={name:"HasBlock",mnemonic:"hasblockload",before:null,stackChange:0,ops:[],operands:0,check:!0},y[o.HasBlockParams]={name:"HasBlockParams",mnemonic:"hasparamsload",before:null,stackChange:-2,ops:[],operands:0,check:!0},y[o.Concat]={name:"Concat",mnemonic:"concat",before:null,stackChange:null,ops:[{name:"count",type:"u32"}],operands:1,check:!0},y[o.IfInline]={name:"IfInline",mnemonic:"ifinline",before:null,stackChange:-2,ops:[{name:"count",type:"u32"}],operands:1,check:!0},y[o.Not]={name:"Not",mnemonic:"not",before:null,stackChange:0,ops:[{name:"count",type:"u32"}],operands:1,check:!0},y[o.Constant]={name:"Constant",mnemonic:"rconstload",before:null,stackChange:1,ops:[{name:"constant",type:"unknown"}],operands:1,check:!0},y[o.ConstantReference]={name:"ConstantReference",mnemonic:"rconstrefload",before:null,stackChange:1,ops:[{name:"constant",type:"unknown"}],operands:1,check:!0},y[o.Primitive]={name:"Primitive",mnemonic:"pconstload",before:null,stackChange:1,ops:[{name:"constant",type:"primitive"}],operands:1,check:!0},y[o.PrimitiveReference]={name:"PrimitiveReference",mnemonic:"ptoref",before:null,stackChange:0,ops:[],operands:0,check:!0},y[o.ReifyU32]={name:"ReifyU32",mnemonic:"reifyload",before:null,stackChange:1,ops:[],operands:0,check:!0},y[o.Dup]={name:"Dup",mnemonic:"dup",before:null,stackChange:1,ops:[{name:"register",type:"u32"},{name:"offset",type:"u32"}],operands:2,check:!0},y[o.Pop]={name:"Pop",mnemonic:"pop",before:null,stackChange:0,ops:[{name:"count",type:"u32"}],operands:1,check:!1},y[o.Load]={name:"Load",mnemonic:"put",before:null,stackChange:-1,ops:[{name:"register",type:"u32"}],operands:1,check:!0},y[o.Fetch]={name:"Fetch",mnemonic:"regload",before:null,stackChange:1,ops:[{name:"register",type:"u32"}],operands:1,check:!0},y[o.RootScope]={name:"RootScope",mnemonic:"rscopepush",before:null,stackChange:0,ops:[{name:"symbols",type:"u32"}],operands:1,check:!0},y[o.VirtualRootScope]={name:"VirtualRootScope",mnemonic:"vrscopepush",before:null,stackChange:0,ops:[{name:"register",type:"u32"}],operands:1,check:!0},y[o.ChildScope]={name:"ChildScope",mnemonic:"cscopepush",before:null,stackChange:0,ops:[],operands:0,check:!0},y[o.PopScope]={name:"PopScope",mnemonic:"scopepop",before:null,stackChange:0,ops:[],operands:0,check:!0},y[o.Text]={name:"Text",mnemonic:"apnd_text",before:null,stackChange:0,ops:[{name:"contents",type:"str"}],operands:1,check:!0},y[o.Comment]={name:"Comment",mnemonic:"apnd_comment",before:null,stackChange:0,ops:[{name:"contents",type:"str"}],operands:1,check:!0},y[o.AppendHTML]={name:"AppendHTML",mnemonic:"apnd_dynhtml",before:null,stackChange:-1,ops:[],operands:0,check:!0},y[o.AppendSafeHTML]={name:"AppendSafeHTML",mnemonic:"apnd_dynshtml",before:null,stackChange:-1,ops:[],operands:0,check:!0},y[o.AppendDocumentFragment]={name:"AppendDocumentFragment",mnemonic:"apnd_dynfrag",before:null,stackChange:-1,ops:[],operands:0,check:!0},y[o.AppendNode]={name:"AppendNode",mnemonic:"apnd_dynnode",before:null,stackChange:-1,ops:[],operands:0,check:!0},y[o.AppendText]={name:"AppendText",mnemonic:"apnd_dyntext",before:null,stackChange:-1,ops:[],operands:0,check:!0},y[o.OpenElement]={name:"OpenElement",mnemonic:"apnd_tag",before:null,stackChange:0,ops:[{name:"tag",type:"str"}],operands:1,check:!0},y[o.OpenDynamicElement]={name:"OpenDynamicElement",mnemonic:"apnd_dyntag",before:null,stackChange:-1,ops:[],operands:0,check:!0},y[o.PushRemoteElement]={name:"PushRemoteElement",mnemonic:"apnd_remotetag",before:null,stackChange:-3,ops:[],operands:0,check:!0},y[o.StaticAttr]={name:"StaticAttr",mnemonic:"apnd_attr",before:null,stackChange:0,ops:[{name:"name",type:"str"},{name:"value",type:"str"},{name:"namespace",type:"option-str"}],operands:3,check:!0},y[o.DynamicAttr]={name:"DynamicAttr",mnemonic:"apnd_dynattr",before:null,stackChange:-1,ops:[{name:"name",type:"str"},{name:"trusting",type:"bool"},{name:"namespace",type:"option-str"}],operands:3,check:!0},y[o.ComponentAttr]={name:"ComponentAttr",mnemonic:"apnd_cattr",before:null,stackChange:-1,ops:[{name:"name",type:"str"},{name:"trusting",type:"bool"},{name:"namespace",type:"option-str"}],operands:3,check:!0},y[o.FlushElement]={name:"FlushElement",mnemonic:"apnd_flushtag",before:null,stackChange:0,ops:[],operands:0,check:!0},y[o.CloseElement]={name:"CloseElement",mnemonic:"apnd_closetag",before:null,stackChange:0,ops:[],operands:0,check:!0},y[o.PopRemoteElement]={name:"PopRemoteElement",mnemonic:"apnd_closeremotetag",before:null,stackChange:0,ops:[],operands:0,check:!0},y[o.Modifier]={name:"Modifier",mnemonic:"apnd_modifier",before:null,stackChange:-1,ops:[{name:"helper",type:"handle"}],operands:1,check:!0},y[o.BindDynamicScope]={name:"BindDynamicScope",mnemonic:"setdynscope",before:null,stackChange:null,ops:[{name:"names",type:"str-array"}],operands:1,check:!0},y[o.PushDynamicScope]={name:"PushDynamicScope",mnemonic:"dynscopepush",before:null,stackChange:0,ops:[],operands:0,check:!0},y[o.PopDynamicScope]={name:"PopDynamicScope",mnemonic:"dynscopepop",before:null,stackChange:0,ops:[],operands:0,check:!0},y[o.CompileBlock]={name:"CompileBlock",mnemonic:"cmpblock",before:null,stackChange:0,ops:[],operands:0,check:!0},y[o.PushBlockScope]={name:"PushBlockScope",mnemonic:"scopeload",before:null,stackChange:1,ops:[{name:"scope",type:"scope"}],operands:1,check:!0},y[o.PushSymbolTable]={name:"PushSymbolTable",mnemonic:"dsymload",before:null,stackChange:1,ops:[{name:"table",type:"symbol-table"}],operands:1,check:!0},y[o.InvokeYield]={name:"InvokeYield",mnemonic:"invokeyield",before:null,stackChange:null,ops:[],operands:0,check:!0},y[o.JumpIf]={name:"JumpIf",mnemonic:"iftrue",before:null,stackChange:-1,ops:[{name:"to",type:"u32"}],operands:1,check:!0},y[o.JumpUnless]={name:"JumpUnless",mnemonic:"iffalse",before:null,stackChange:-1,ops:[{name:"to",type:"u32"}],operands:1,check:!0},y[o.JumpEq]={name:"JumpEq",mnemonic:"ifeq",before:null,stackChange:0,ops:[{name:"to",type:"i32"},{name:"comparison",type:"i32"}],operands:2,check:!0},y[o.AssertSame]={name:"AssertSame",mnemonic:"assert_eq",before:null,stackChange:0,ops:[],operands:0,check:!0},y[o.Enter]={name:"Enter",mnemonic:"blk_start",before:null,stackChange:0,ops:[{name:"args",type:"u32"}],operands:1,check:!0},y[o.Exit]={name:"Exit",mnemonic:"blk_end",before:null,stackChange:0,ops:[],operands:0,check:!0},y[o.ToBoolean]={name:"ToBoolean",mnemonic:"anytobool",before:null,stackChange:0,ops:[],operands:0,check:!0},y[o.EnterList]={name:"EnterList",mnemonic:"list_start",before:null,stackChange:null,ops:[{name:"address",type:"u32"},{name:"address",type:"u32"}],operands:2,check:!0},y[o.ExitList]={name:"ExitList",mnemonic:"list_end",before:null,stackChange:0,ops:[],operands:0,check:!0},y[o.Iterate]={name:"Iterate",mnemonic:"iter",before:null,stackChange:0,ops:[{name:"end",type:"u32"}],operands:1,check:!1},y[o.Main]={name:"Main",mnemonic:"main",before:null,stackChange:-2,ops:[{name:"state",type:"register"}],operands:1,check:!0},y[o.ContentType]={name:"ContentType",mnemonic:"ctload",before:null,stackChange:1,ops:[],operands:0,check:!0},y[o.DynamicContentType]={name:"DynamicContentType",mnemonic:"dctload",before:null,stackChange:1,ops:[],operands:0,check:!0},y[o.Curry]={name:"Curry",mnemonic:"curry",before:null,stackChange:null,ops:[{name:"type",type:"u32"},{name:"is-strict",type:"bool"}],operands:2,check:!0},y[o.PushComponentDefinition]={name:"PushComponentDefinition",mnemonic:"cmload",before:null,stackChange:1,ops:[{name:"spec",type:"handle"}],operands:1,check:!0},y[o.PushDynamicComponentInstance]={name:"PushDynamicComponentInstance",mnemonic:"dciload",before:null,stackChange:0,ops:[],operands:0,check:!0},y[o.ResolveDynamicComponent]={name:"ResolveDynamicComponent",mnemonic:"cdload",before:null,stackChange:0,ops:[{name:"owner",type:"owner"}],operands:1,check:!0},y[o.PushArgs]={name:"PushArgs",mnemonic:"argsload",before:null,stackChange:null,ops:[{name:"names",type:"str-array"},{name:"block-names",type:"str-array"},{name:"flags",type:"u32"}],operands:3,check:!0},y[o.PushEmptyArgs]={name:"PushEmptyArgs",mnemonic:"emptyargsload",before:null,stackChange:1,ops:[],operands:0,check:!0},y[o.PopArgs]={name:"PopArgs",mnemonic:"argspop",before:null,stackChange:null,ops:[],operands:0,check:!0},y[o.PrepareArgs]={name:"PrepareArgs",mnemonic:"argsprep",before:null,stackChange:0,ops:[{name:"state",type:"register"}],operands:1,check:!1},y[o.CaptureArgs]={name:"CaptureArgs",mnemonic:"argscapture",before:null,stackChange:0,ops:[],operands:0,check:!0},y[o.CreateComponent]={name:"CreateComponent",mnemonic:"comp_create",before:null,stackChange:0,ops:[{name:"flags",type:"u32"},{name:"state",type:"register"}],operands:2,check:!0},y[o.RegisterComponentDestructor]={name:"RegisterComponentDestructor",mnemonic:"comp_dest",before:null,stackChange:0,ops:[{name:"state",type:"register"}],operands:1,check:!0},y[o.PutComponentOperations]={name:"PutComponentOperations",mnemonic:"comp_elops",before:null,stackChange:0,ops:[],operands:0,check:!0},y[o.GetComponentSelf]={name:"GetComponentSelf",mnemonic:"comp_selfload",before:null,stackChange:1,ops:[{name:"state",type:"register"}],operands:1,check:!0},y[o.GetComponentTagName]={name:"GetComponentTagName",mnemonic:"comp_tagload",before:null,stackChange:1,ops:[{name:"state",type:"register"}],operands:1,check:!0},y[o.GetComponentLayout]={name:"GetComponentLayout",mnemonic:"comp_layoutload",before:null,stackChange:2,ops:[{name:"state",type:"register"}],operands:1,check:!0},y[o.BindEvalScope]={name:"BindEvalScope",mnemonic:"eval_scope",before:null,stackChange:0,ops:[{name:"state",type:"register"}],operands:1,check:!0},y[o.SetupForEval]={name:"SetupForEval",mnemonic:"eval_setup",before:null,stackChange:0,ops:[{name:"state",type:"register"}],operands:1,check:!0},y[o.PopulateLayout]={name:"PopulateLayout",mnemonic:"comp_layoutput",before:null,stackChange:-2,ops:[{name:"state",type:"register"}],operands:1,check:!0},y[o.InvokeComponentLayout]={name:"InvokeComponentLayout",mnemonic:"comp_invokelayout",before:null,stackChange:0,ops:[{name:"state",type:"register"}],operands:1,check:!0},y[o.BeginComponentTransaction]={name:"BeginComponentTransaction",mnemonic:"comp_begin",before:null,stackChange:0,ops:[],operands:0,check:!0},y[o.CommitComponentTransaction]={name:"CommitComponentTransaction",mnemonic:"comp_commit",before:null,stackChange:0,ops:[],operands:0,check:!0},y[o.DidCreateElement]={name:"DidCreateElement",mnemonic:"comp_created",before:null,stackChange:0,ops:[{name:"state",type:"register"}],operands:1,check:!0},y[o.DidRenderLayout]={name:"DidRenderLayout",mnemonic:"comp_rendered",before:null,stackChange:0,ops:[{name:"state",type:"register"}],operands:1,check:!0},y[o.ResolveMaybeLocal]={name:"ResolveMaybeLocal",mnemonic:"eval_varload",before:null,stackChange:1,ops:[{name:"local",type:"str"}],operands:1,check:!0},y[o.Debugger]={name:"Debugger",mnemonic:"debugger",before:null,stackChange:0,ops:[{name:"symbols",type:"str-array"},{name:"debugInfo",type:"array"}],operands:2,check:!0};const x=["u32","i32","owner","handle","str","option-str","array","str-array","bool","primitive","register","unknown","symbol-table","scope"];function E(e,n){let t;if(void 0===n.format)throw new Error(`Missing format in ${JSON.stringify(n)}`);t=Array.isArray(n.format)?n.format[0]:n.format;let a=Array.isArray(n.format)?function(e){if(!Array.isArray(e))throw new Error(`Expected operands array, got ${JSON.stringify(e)}`);return e.map(_)}(n.format.slice(1)):[];return{name:t,mnemonic:e,before:null,stackChange:$(n["operand-stack"]),ops:a,operands:a.length,check:!0!==n.skip}}function $(e){if(void 0===e)return 0;let n=e[0],t=e[1];return P(n)||P(t)?null:t.length-n.length}function P(e){if(!Array.isArray(e))throw new Error(`Unexpected stack entry: ${JSON.stringify(e)}`);return e.some((e=>"..."===e.slice(-3)))}function _(e){let[n,t]=e.split(":");if(a=t,-1!==x.indexOf(a))return{name:n,type:t};throw new Error(`Expected operand, found ${JSON.stringify(e)}`);var a}function T(e){return{machine:D(e.machine),syscall:D(e.syscall)}}function D(e){let n=Object.create(null);for(const[t,a]of Object.entries(e))n[t]=E(t,a);return n}function O(e,n,t,a){let o,r=[`export enum ${e} {`];Object.values(n).forEach(((e,n)=>{r.push(` ${e.name} = ${t+n},`),o=n})),r.push(` Size = ${o+t+1},`),r.push("}");let c,s=r.join("\n");return c=a?R` | ||
} | ||
`,{enumString:s,predicate:c}}function R(e,...n){let t="";for(let a=0;a<e.length;a++){t+=`${e[a]}${void 0!==n[a]?String(n[a]):""}`}t=/^\s*?\n?([\s\S]*?)\s*$/u.exec(t)[1];let a=Number.MAX_SAFE_INTEGER;for(let e of t.split("\n")){let n=/^\s*/u.exec(e)[0].length;a=Math.min(a,n)}let o="";for(let e of t.split("\n"))o+=e.slice(a)+"\n";return o}const j=["METADATA","MACHINE_METADATA"];function B(e,n,t){return`${e}[${"MACHINE_METADATA"===e?"MachineOp":"Op"}.${n[t].name}] = ${M(n[t],0)};`}function M(e,n){if("object"!=typeof e||null===e)return"string"==typeof e?`'${e}'`:JSON.stringify(e);if(Array.isArray(e))return`[${e.map((e=>M(e,n))).join(", ")}]`;let t=["{"];for(let a of Object.keys(e))t.push(`${" ".repeat(n+2)}${a}: ${M(e[a],n+2)},`);return t.push(`${" ".repeat(n)}}`),t.join("\n")}function I(e,n){let t=[];for(let a of Object.keys(n))t.push(B(e,n,a));return t.join("\n\n")}function L(e){return new class{validate(n){return e().validate(n)}expected(){return e().expected()}}}class N{constructor(e){this.expectedType=e}validate(e){return typeof e===this.expectedType}expected(){return`typeof ${this.expectedType}`}}class G{constructor(e){this.Class=e}validate(e){return!!e&&e instanceof this.Class}expected(){return`an instance of ${this.Class.name}`}}class H{constructor(e,n){this.checker=e,this.emptyValue=n}validate(e){return e===this.emptyValue||this.checker.validate(e)}expected(){return`${this.checker.expected()} or null`}}class J{constructor(e){this.checker=e}validate(e){return null==e||this.checker.validate(e)}expected(){return`${this.checker.expected()} or null or undefined`}}class V{constructor(e,n){this.left=e,this.right=n}validate(e){return this.left.validate(e)||this.right.validate(e)}expected(){return`${this.left.expected()} or ${this.right.expected()}`}}class F{constructor(e,n){this.value=e,this.desc=n}validate(e){return e===this.value}expected(){return this.desc}}class U{constructor(e){this.checkers=e}validate(e){return"object"==typeof e&&(null!=e&&Object.entries(this.checkers).every((([n,t])=>n in e&&t.validate(e[n]))))}expected(){return`{ ${Object.entries(this.checkers).map((([e,n])=>`${e}: ${n.expected()}`)).join(",")} }`}}class q{constructor(e){this.checker=e}validate(e){return null!=e&&(!!Array.isArray(e)&&e.every((e=>this.checker.validate(e))))}expected(){return`Array<${this.checker.expected()}>`}}class z{constructor(e){this.checker=e}validate(e){if(!("object"==typeof e&&null!==e&&null===Object.getPrototypeOf(e)))return!1;let{checker:n}=this;for(let t in e)if(!n.validate(e[t]))return!1;return!0}expected(){return"a primitive"}}function Y(e){return new G(e)}function W(e){return new H(e,null)}function X(e){return new J(e)}function K(e){return new U(e)}function Q(e){return new q(e)}function Z(e){return new z(e)}function ee(e,n){return`Got ${e}, expected:\n${n}`}function ne(e,n,t=ee){if("function"==typeof n)return n(e),e;if(n.validate(e))return e;throw new Error(t(e,n.expected()))}let te=0;function ae(e){te=e}function oe(e,n,t){let a=e.sp-te;if(a!==n)throw new Error(`Expected stack to change by ${n}, but it changed by ${a} in ${t}`)}const re=new class{validate(e){return"string"!=typeof e||"number"==typeof e||"string"==typeof e||null==e}expected(){return"a primitive"}},ce=new N("function"),se=new N("number"),pe=new N("boolean"),me=se,le=new N("string"),ie=new class{validate(e){return null===e}expected(){return"null"}},ue=new class{type;validate(e){return!0}expected(){return"any"}},he=new class{validate(e){return"object"==typeof e&&null!==e&&"function"==typeof e.toHTML}expected(){return"SafeString"}},de=new class{validate(e){return"function"==typeof e||"object"==typeof e&&null!==e}expected(){return"an object or function (valid WeakMap key)"}};function fe(e,n){return new V(e,n)}function ke(e,n=String(e)){return new F(e,n)}const ye=K({parameters:Q(se)}),ge=K({hasEval:pe,symbols:Q(le)}),be=K({nodeType:ke(1),tagName:le,nextSibling:ue}),Ce=K({nodeType:ke(11),nextSibling:ue}),ve=K({nodeType:se,nextSibling:ue});export{Q as CheckArray,ye as CheckBlockSymbolTable,pe as CheckBoolean,Z as CheckDict,Ce as CheckDocumentFragment,be as CheckElement,ce as CheckFunction,me as CheckHandle,Y as CheckInstanceof,K as CheckInterface,X as CheckMaybe,ve as CheckNode,ie as CheckNull,se as CheckNumber,de as CheckObject,W as CheckOption,fe as CheckOr,re as CheckPrimitive,ge as CheckProgramSymbolTable,he as CheckSafeString,le as CheckString,ue as CheckUnknown,ke as CheckValue,j as META_KIND,x as OPERAND_TYPES,O as buildEnum,I as buildMetas,B as buildSingleMeta,ne as check,v as debug,b as debugSlice,oe as expectStackChange,C as logOpcode,E as normalize,T as normalizeAll,D as normalizeParsed,k as opcodeMetadata,ae as recordStackSize,R as strip,L as wrap}; | ||
`,{enumString:s,predicate:c}}function R(e,...n){let t="";for(let a=0;a<e.length;a++){t+=`${e[a]}${void 0!==n[a]?String(n[a]):""}`}t=/^\s*?\n?([\s\S]*?)\s*$/u.exec(t)[1];let a=Number.MAX_SAFE_INTEGER;for(let e of t.split("\n")){let n=/^\s*/u.exec(e)[0].length;a=Math.min(a,n)}let o="";for(let e of t.split("\n"))o+=e.slice(a)+"\n";return o}const j=["METADATA","MACHINE_METADATA"];function B(e,n,t){return`${e}[${"MACHINE_METADATA"===e?"MachineOp":"Op"}.${n[t].name}] = ${M(n[t],0)};`}function M(e,n){if("object"!=typeof e||null===e)return"string"==typeof e?`'${e}'`:JSON.stringify(e);if(Array.isArray(e))return`[${e.map((e=>M(e,n))).join(", ")}]`;let t=["{"];for(let a of Object.keys(e))t.push(`${" ".repeat(n+2)}${a}: ${M(e[a],n+2)},`);return t.push(`${" ".repeat(n)}}`),t.join("\n")}function I(e,n){let t=[];for(let a of Object.keys(n))t.push(B(e,n,a));return t.join("\n\n")}function L(e){return new class{validate(n){return e().validate(n)}expected(){return e().expected()}}}class N{constructor(e){this.expectedType=e}validate(e){return typeof e===this.expectedType}expected(){return`typeof ${this.expectedType}`}}class G{constructor(e){this.Class=e}validate(e){return!!e&&e instanceof this.Class}expected(){return`an instance of ${this.Class.name}`}}class H{constructor(e,n){this.checker=e,this.emptyValue=n}validate(e){return e===this.emptyValue||this.checker.validate(e)}expected(){return`${this.checker.expected()} or null`}}class J{constructor(e){this.checker=e}validate(e){return null==e||this.checker.validate(e)}expected(){return`${this.checker.expected()} or null or undefined`}}class V{constructor(e,n){this.left=e,this.right=n}validate(e){return this.left.validate(e)||this.right.validate(e)}expected(){return`${this.left.expected()} or ${this.right.expected()}`}}class F{constructor(e,n){this.value=e,this.desc=n}validate(e){return e===this.value}expected(){return this.desc}}class U{constructor(e){this.checkers=e}validate(e){return"object"==typeof e&&(null!=e&&Object.entries(this.checkers).every((([n,t])=>n in e&&t.validate(e[n]))))}expected(){return`{ ${Object.entries(this.checkers).map((([e,n])=>`${e}: ${n.expected()}`)).join(",")} }`}}class q{constructor(e){this.checker=e}validate(e){return null!=e&&(!!Array.isArray(e)&&e.every((e=>this.checker.validate(e))))}expected(){return`Array<${this.checker.expected()}>`}}class z{constructor(e){this.checker=e}validate(e){if(!("object"==typeof e&&null!==e&&null===Object.getPrototypeOf(e)))return!1;let{checker:n}=this;for(let t in e)if(!n.validate(e[t]))return!1;return!0}expected(){return"a primitive"}}function Y(e){return new G(e)}function W(e){return new H(e,null)}function X(e){return new J(e)}function K(e){return new U(e)}function Q(e){return new q(e)}function Z(e){return new z(e)}function ee(e,n){return`Got ${e}, expected:\n${n}`}function ne(e,n,t=ee){if("function"==typeof n)return n(e),e;if(n.validate(e))return e;throw new Error(t(e,n.expected()))}let te=0;function ae(e){te=e}function oe(e,n,t){let a=e.sp-te;if(a!==n)throw new Error(`Expected stack to change by ${n}, but it changed by ${a} in ${t}`)}const re=new class{validate(e){return"string"!=typeof e||"number"==typeof e||"string"==typeof e||null==e}expected(){return"a primitive"}},ce=new N("function"),se=new N("number"),pe=new N("boolean"),me=se,le=new N("string"),ie=new class{validate(e){return null===e}expected(){return"null"}},ue=new class{validate(e){return void 0===e}expected(){return"undefined"}},he=new class{type;validate(e){return!0}expected(){return"any"}},de=new class{validate(e){return"object"==typeof e&&null!==e&&"function"==typeof e.toHTML}expected(){return"SafeString"}},fe=new class{validate(e){return"function"==typeof e||"object"==typeof e&&null!==e}expected(){return"an object or function (valid WeakMap key)"}};function ke(e,n){return new V(e,n)}function ye(e,n=String(e)){return new F(e,n)}const ge=K({parameters:Q(se)}),be=K({hasEval:pe,symbols:Q(le)}),Ce=K({nodeType:ye(1),tagName:le,nextSibling:he}),ve=K({nodeType:ye(11),nextSibling:he}),Se=K({nodeType:se,nextSibling:he});export{Q as CheckArray,ge as CheckBlockSymbolTable,pe as CheckBoolean,Z as CheckDict,ve as CheckDocumentFragment,Ce as CheckElement,ce as CheckFunction,me as CheckHandle,Y as CheckInstanceof,K as CheckInterface,X as CheckMaybe,Se as CheckNode,ie as CheckNull,se as CheckNumber,fe as CheckObject,W as CheckOption,ke as CheckOr,re as CheckPrimitive,be as CheckProgramSymbolTable,de as CheckSafeString,le as CheckString,ue as CheckUndefined,he as CheckUnknown,ye as CheckValue,j as META_KIND,x as OPERAND_TYPES,O as buildEnum,I as buildMetas,B as buildSingleMeta,ne as check,v as debug,b as debugSlice,oe as expectStackChange,C as logOpcode,E as normalize,T as normalizeAll,D as normalizeParsed,k as opcodeMetadata,ae as recordStackSize,R as strip,L as wrap}; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@glimmer/debug", | ||
"version": "0.88.1", | ||
"version": "0.89.0", | ||
"repository": "https://github.com/glimmerjs/glimmer-vm/tree/main/packages/@glimmer/debug", | ||
@@ -23,5 +23,5 @@ "type": "module", | ||
"dependencies": { | ||
"@glimmer/interfaces": "^0.88.1", | ||
"@glimmer/util": "^0.88.1", | ||
"@glimmer/vm": "^0.88.1" | ||
"@glimmer/interfaces": "^0.89.0", | ||
"@glimmer/util": "^0.89.0", | ||
"@glimmer/vm": "^0.89.0" | ||
}, | ||
@@ -35,3 +35,3 @@ "devDependencies": { | ||
"@glimmer-workspace/build-support": "^1.0.0", | ||
"@glimmer/local-debug-flags": "^0.88.1" | ||
"@glimmer/local-debug-flags": "^0.89.0" | ||
}, | ||
@@ -38,0 +38,0 @@ "scripts": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
217986
3421
+ Added@glimmer/interfaces@0.89.0(transitive)
+ Added@glimmer/util@0.89.0(transitive)
+ Added@glimmer/vm@0.89.0(transitive)
- Removed@glimmer/interfaces@0.88.1(transitive)
- Removed@glimmer/util@0.88.1(transitive)
- Removed@glimmer/vm@0.88.1(transitive)
Updated@glimmer/interfaces@^0.89.0
Updated@glimmer/util@^0.89.0
Updated@glimmer/vm@^0.89.0