added debugger vscode js

This commit is contained in:
Tawfeeq 2025-01-19 11:54:28 +01:00
parent 4b43e2f49e
commit 8d05a545d1
61 changed files with 888 additions and 7 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1 @@
*{margin:0;padding:0}:root{--subtle-bg: rgba(0, 0, 0, .05)}body{color:var(--vscode-foreground)}a{cursor:pointer;text-decoration:underline}a:hover{text-decoration:none}.back{padding:1rem 0;display:inline-block}.intro{display:flex;height:100vh;justify-content:center;align-items:center}.intro>div{overflow:hidden;box-shadow:0 5px 30px #0003;border:1px solid var(--vscode-notebook-focusedCellBorder)}.intro>div,.content,.source-container.expanded{background:var(--vscode-notebook-focusedCellBackground);border:1px solid var(--vscode-notebook-focusedCellBorder)}.intro header{background:var(--subtle-bg);padding:1rem}.intro-content{padding:1rem}.intro-content li{list-style-type:none}.intro-content li a{display:block;margin-top:.5rem;padding:.5rem}.intro-content li a:hover{background:var(--subtle-bg)}.content{margin:2rem;padding:1rem}.source-filter{display:block;width:100%;padding:.5rem;font-size:1.1rem;margin-bottom:.5rem;background:var(--vscode-input-background);color:var(--vscode-input-foreground);border:none}.source-container{padding:.5rem}.source-container code{word-break:break-all}.source-container.expanded+.source-container.expanded{border-top:none}.source-container h2{font-family:var(--editor-font-family);font-weight:300;cursor:pointer;opacity:.8;font-size:1.2rem;user-select:none}.source-container h2:hover{opacity:1}.source-container.expanded h2{margin-bottom:.5rem}.source-data-grid{display:grid;grid-template-columns:25% 75%;row-gap:.5rem;padding:.5rem .25rem}.source-data-grid li{list-style-type:none}.source-breadcrumbs{padding:.5rem .25rem .75rem;border-bottom:1px solid rgba(0,0,0,.1)}.source-breadcrumbs li{display:inline;list-style-type:none}.bp-tracing code{font-size:var(--vscode-editor-font-size)}.bp-tracing li{margin:1rem 0 1rem 1rem}.bp-tracing p{margin:.5rem 0}.bp-tracing li ul{margin:.5rem 1rem}.decision-buttons{margin:.5rem 0}button{background:var(--vscode-button-background);color:var(--vscode-button-foreground);border:0;padding:.3rem .6rem;cursor:pointer}button:hover,button:focus{background:var(--vscode-button-hoverBackground)}.decision-buttons button+button{margin-left:.25rem}.decision-buttons button.active{background:var(--vscode-button-hoverBackground)}.text-diff .add{background:var(--vscode-diffEditor-insertedTextBackground);border:1px solid var(--vscode-diffEditor-insertedTextBorder)}.text-diff .rm{background:var(--vscode-diffEditor-removedTextBackground);text-decoration:line-through;border:1px solid var(--vscode-diffEditor-removedTextBorder)}

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,4 @@
"use strict";(()=>{var W=Object.create;var H=Object.defineProperty;var k=Object.getOwnPropertyDescriptor;var C=Object.getOwnPropertyNames;var N=Object.getPrototypeOf,j=Object.prototype.hasOwnProperty;var d=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var F=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var L=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of C(t))!j.call(e,s)&&s!==r&&H(e,s,{get:()=>t[s],enumerable:!(n=k(t,s))||n.enumerable});return e};var I=(e,t,r)=>(r=e!=null?W(N(e)):{},L(t||!e||!e.__esModule?H(r,"default",{value:e,enumerable:!0}):r,e));var O=F((me,u)=>{var T={};T.__wbindgen_placeholder__=u.exports;var c,{TextDecoder:G}=d("util"),M=new G("utf-8",{ignoreBOM:!0,fatal:!0});M.decode();var f=null;function x(){return(f===null||f.buffer!==c.memory.buffer)&&(f=new Uint8Array(c.memory.buffer)),f}function J(e,t){return M.decode(x().subarray(e,e+t))}var B=0;function q(e,t){let r=t(e.length*1);return x().set(e,r/1),B=e.length,r}var g=class e{static __wrap(t){let r=Object.create(e.prototype);return r.ptr=t,r}__destroy_into_raw(){let t=this.ptr;return this.ptr=0,t}free(){let t=this.__destroy_into_raw();c.__wbg_hasher_free(t)}constructor(){var t=c.hasher_new();return e.__wrap(t)}update(t){var r=q(t,c.__wbindgen_malloc),n=B;c.hasher_update(this.ptr,r,n)}digest(t){try{var r=q(t,c.__wbindgen_malloc),n=B;c.hasher_digest(this.ptr,r,n)}finally{t.set(x().subarray(r/1,r/1+n)),c.__wbindgen_free(r,n*1)}}};u.exports.Hasher=g;u.exports.__wbindgen_throw=function(e,t){throw new Error(J(e,t))};var K=d("path").join(__dirname,"chromehash_bg.wasm"),Q=d("fs").readFileSync(K),X=new WebAssembly.Module(Q),Y=new WebAssembly.Instance(X,T);c=Y.exports;u.exports.__wasm=c});var U=F(l=>{"use strict";Object.defineProperty(l,"__esModule",{value:!0});l.shaHashFile=l.hashFile=l.shaHash=l.hash=void 0;var D=O(),S=d("fs"),P=d("string_decoder"),E=d("crypto"),y=Buffer.alloc(4*5),Z=e=>{let t=new D.Hasher;return t.update(te(e)),t.digest(y),t.free(),y.toString("hex")};l.hash=Z;var $=e=>{let t=(0,E.createHash)("sha256");return t.update(re(e)),t.digest("hex")};l.shaHash=$;var z=async(e,t=4096)=>{t%2===1&&t++;let r=Buffer.alloc(t),n=new D.Hasher,s;try{s=await S.promises.open(e,"r");let a=await s.read(r,0,r.length,null),i=r.slice(0,a.bytesRead);if(w(i))for(n.update(i.slice(2));a.bytesRead===r.length;)a=await s.read(r,0,r.length,null),n.update(r.slice(0,a.bytesRead));else if(_(i))for(n.update(i.slice(2).swap16());a.bytesRead===r.length;)a=await s.read(r,0,r.length,null),n.update(r.slice(0,a.bytesRead).swap16());else if(m(i)){let o=new P.StringDecoder("utf8");for(n.update(Buffer.from(o.write(i.slice(3)),"utf16le"));a.bytesRead===r.length;)a=await s.read(r,0,r.length,null),n.update(Buffer.from(o.write(r.slice(0,a.bytesRead)),"utf16le"))}else{let o=new P.StringDecoder("utf8");for(n.update(Buffer.from(o.write(i),"utf16le"));a.bytesRead===r.length;)a=await s.read(r,0,r.length,null),n.update(Buffer.from(o.write(r.slice(0,a.bytesRead)),"utf16le"))}return n.digest(y),y.toString("hex")}finally{n.free(),s!==void 0&&await s.close()}};l.hashFile=z;var p={stream:!0},ee=async(e,t=4096)=>{t%2===1&&t++;let r=Buffer.alloc(t),n=(0,E.createHash)("sha256"),s;try{s=await S.promises.open(e,"r");let a=await s.read(r,0,r.length,null),i=r.slice(0,a.bytesRead);if(w(i)){let o=new TextDecoder("utf-16le");for(n.update(o.decode(i.slice(2),p));a.bytesRead>0;)a=await s.read(r,0,r.length,null),n.update(o.decode(r.slice(0,a.bytesRead),p))}else if(_(i)){let o=new TextDecoder("utf-16be");for(n.update(o.decode(i.slice(2),p));a.bytesRead>0;)a=await s.read(r,0,r.length,null),n.update(o.decode(r.slice(0,a.bytesRead),p))}else if(m(i))for(n.update(i.slice(3));a.bytesRead>0;)a=await s.read(r,0,r.length,null),n.update(r.slice(0,a.bytesRead));else for(n.update(i);a.bytesRead>0;)a=await s.read(r,0,r.length,null),n.update(r.slice(0,a.bytesRead));return n.digest("hex")}finally{await s?.close()}};l.shaHashFile=ee;var m=e=>e.length>=3&&e[0]===239&&e[1]===187&&e[2]===191,w=e=>e.length>=2&&e[0]===255&&e[1]===254,_=e=>e.length>=2&&e[0]===254&&e[1]===255,te=e=>m(e)?v(e.slice(3)):w(e)?e.slice(2):_(e)?e.slice(2).swap16():v(e),re=e=>m(e)?e.slice(3):w(e)?new TextEncoder().encode(new TextDecoder("utf-16le").decode(e.slice(2))):_(e)?new TextEncoder().encode(new TextDecoder("utf-16be").decode(e.slice(2))):e,v=e=>Buffer.from(e.toString("utf8"),"utf16le")});var h=I(U()),b=d("fs"),R=d("worker_threads"),se=(s=>(s[s.HashFile=0]="HashFile",s[s.HashBytes=1]="HashBytes",s[s.VerifyFile=2]="VerifyFile",s[s.VerifyBytes=3]="VerifyBytes",s))(se||{}),ne=(r=>(r[r.Chromehash=0]="Chromehash",r[r.SHA256=1]="SHA256",r))(ne||{}),ae=Buffer.from("(function (exports, require, module, __filename, __dirname) { "),ie=Buffer.from(`
});`),oe=Buffer.from("(function (exports, require, module, __filename, __dirname, process, global, Buffer) { return function (exports, require, module, __filename, __dirname) { "),ce=Buffer.from(`
}.call(this, exports, require, module, __filename, __dirname); });`),le=Buffer.from("#!"),de=Buffer.from("\r")[0],he=Buffer.from(`
`)[0],ue=(e,t)=>e.slice(0,t.length).equals(t),V=(e,t,r)=>{let n=t.length===64?h.shaHash:h.hash;if(n(e)===t)return!0;if(r){if(ue(e,le)){let s=e.indexOf(he);return e[s-1]===de&&s--,n(e.slice(s))===t}if(n(Buffer.concat([ae,e,ie]))===t)return!0}return n(Buffer.concat([oe,e,ce]))===t},A=e=>e instanceof Buffer?e:Buffer.from(e,"utf-8");async function fe(e){switch(e.type){case 0:try{let t=await b.promises.readFile(e.file);return{id:e.id,hash:e.mode===0?(0,h.hash)(t):(0,h.shaHash)(t)}}catch{return{id:e.id}}case 1:try{return{id:e.id,hash:(0,h.hash)(A(e.data))}}catch{return{id:e.id}}case 2:try{let t=await b.promises.readFile(e.file);return{id:e.id,matches:V(t,e.expected,e.checkNode)}}catch{return{id:e.id,matches:!1}}case 3:try{return{id:e.id,matches:V(A(e.data),e.expected,e.checkNode)}}catch{return{id:e.id,matches:!1}}}}function pe(e){e.on("message",t=>{fe(t).then(r=>e.postMessage(r))})}R.parentPort&&pe(R.parentPort);})();

View file

@ -0,0 +1 @@
"use strict";(()=>{var d=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(r,s)=>(typeof require<"u"?require:r)[s]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var p=d("worker_threads");var x=d("./vendor/acorn.js"),f=d("./vendor/acorn-loose.js");var m={ArrayExpression:["elements"],ArrayPattern:["elements"],ArrowFunctionExpression:["params","body"],AssignmentExpression:["left","right"],AssignmentPattern:["left","right"],AwaitExpression:["argument"],BinaryExpression:["left","right"],BlockStatement:["body"],BreakStatement:["label"],CallExpression:["callee","arguments"],CatchClause:["param","body"],ChainExpression:["expression"],ClassBody:["body"],ClassDeclaration:["id","superClass","body"],ClassExpression:["id","superClass","body"],ConditionalExpression:["test","consequent","alternate"],ContinueStatement:["label"],DebuggerStatement:[],DoWhileStatement:["body","test"],EmptyStatement:[],ExperimentalRestProperty:["argument"],ExperimentalSpreadProperty:["argument"],ExportAllDeclaration:["exported","source"],ExportDefaultDeclaration:["declaration"],ExportNamedDeclaration:["declaration","specifiers","source"],ExportSpecifier:["exported","local"],ExpressionStatement:["expression"],ForInStatement:["left","right","body"],ForOfStatement:["left","right","body"],ForStatement:["init","test","update","body"],FunctionDeclaration:["id","params","body"],FunctionExpression:["id","params","body"],Identifier:[],IfStatement:["test","consequent","alternate"],ImportDeclaration:["specifiers","source"],ImportDefaultSpecifier:["local"],ImportExpression:["source"],ImportNamespaceSpecifier:["local"],ImportSpecifier:["imported","local"],JSXAttribute:["name","value"],JSXClosingElement:["name"],JSXClosingFragment:[],JSXElement:["openingElement","children","closingElement"],JSXEmptyExpression:[],JSXExpressionContainer:["expression"],JSXFragment:["openingFragment","children","closingFragment"],JSXIdentifier:[],JSXMemberExpression:["object","property"],JSXNamespacedName:["namespace","name"],JSXOpeningElement:["name","attributes"],JSXOpeningFragment:[],JSXSpreadAttribute:["argument"],JSXSpreadChild:["expression"],JSXText:[],LabeledStatement:["label","body"],Literal:[],LogicalExpression:["left","right"],MemberExpression:["object","property"],MetaProperty:["meta","property"],MethodDefinition:["key","value"],NewExpression:["callee","arguments"],ObjectExpression:["properties"],ObjectPattern:["properties"],PrivateIdentifier:[],Program:["body"],Property:["key","value"],PropertyDefinition:["key","value"],RestElement:["argument"],ReturnStatement:["argument"],SequenceExpression:["expressions"],SpreadElement:["argument"],StaticBlock:["body"],Super:[],SwitchCase:["test","consequent"],SwitchStatement:["discriminant","cases"],TaggedTemplateExpression:["tag","quasi"],TemplateElement:[],TemplateLiteral:["quasis","expressions"],ThisExpression:[],ThrowStatement:["argument"],TryStatement:["block","handler","finalizer"],UnaryExpression:["argument"],UpdateExpression:["argument"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],WhileStatement:["test","body"],WithStatement:["object","body"],YieldExpression:["argument"]},b=Object.keys(m);for(let t of b)Object.freeze(m[t]);Object.freeze(m);var u=m;var h={ecmaVersion:"latest",locations:!0,allowAwaitOutsideFunction:!0,allowImportExportEverywhere:!0,allowReserved:!0,allowReturnOutsideFunction:!0};var S=(t,r=!1)=>(r?x.parse:f.parse)(t,h);var g=(t,r)=>{y(t,r)};var y=(t,r,s)=>{if(!t)return;let n=r.enter(t,s);if(n===0)return 0;if(n&&typeof n=="object")return n;if(n===1)return;let i=u[t.type];if(i)for(let a of i){let e=t[a];if(e instanceof Array)for(let[o,l]of e.entries()){let c=y(l,r,t);if(c===0)return 0;c&&typeof c=="object"&&(e[o]=c.replace)}else if(e){let o=y(e,r,t);if(o===0)return 0;o&&typeof o=="object"&&(t[a]=o.replace)}}r.leave?.(t)};function k(t){let r=S(t),s=[],n=(e,{loc:o}=e,{loc:l}=e)=>{if(!o||!l)throw new Error("should include locations");s.push({start:o.start,end:l.end,depth:a.length}),a.push(e)},i=new Set,a=[];return g(r,{enter:e=>{switch(e.type){case"FunctionDeclaration":case"ArrowFunctionExpression":n(e,e.params[0]||e.body,e.body),i.add(e.body);break;case"Program":n(e);break;case"ForStatement":case"ForOfStatement":case"ForInStatement":n(e),i.add(e.body);break;case"BlockStatement":i.has(e)||n(e);break}},leave:e=>{e===a[a.length-1]&&a.pop()}}),s}p.isMainThread||p.parentPort?.postMessage(k(p.workerData));})();

View file

@ -0,0 +1,13 @@
#!/bin/bash
ROOT_PID=$1
SIGNAL=$2
terminateTree() {
for cpid in $(pgrep -P $1); do
terminateTree $cpid
done
kill -$SIGNAL $1 > /dev/null 2>&1
}
terminateTree $ROOT_PID

View file

@ -0,0 +1,93 @@
{
"name": "WebAssembly Text Format",
"scopeName": "text.wat",
"patterns": [
{ "include": "#block-comment" },
{ "include": "#line-comment" },
{ "include": "#expr" }
],
"repository": {
"op": {
"match": "[a-zA-Z0-9!#$%&`*+\\-/:<=>?@\\\\^_|~\\.]+",
"name": "keyword"
},
"id": {
"match": "\\$[A-Za-z0-9!#$%&`*+\\-/:<=>?@\\\\^_|~\\.]+",
"name": "variable"
},
"decimal-number": {
"match": "\\b[+-]?[0-9_]+(.[0-9_]+)?([Ee][+-][0-9_]+)?\\b",
"name": "constant.numeric"
},
"hexadecimal-number": {
"match": "\\b[+-]?0x[0-9a-fA-F_]+(.[0-9a-fA-F_]+)?([pP][+-][0-9a-fA-F_]+)?\\b",
"name": "constant.numeric"
},
"number-special": {
"match": "\\b[+-]?(inf|nan(:0x[0-9]+)?)\\b",
"name": "constant.numeric"
},
"memarg": {
"match": "\\b(offset|align)(=)([0-9_]+)\\b",
"name": "keyword",
"captures": {
"1": { "name": "keyword" },
"2": { "name": "keyword.operator.arithmetic" },
"3": { "name": "constant.numeric" }
}
},
"any-number": {
"patterns": [
{ "include": "#decimal-number" },
{ "include": "#hexadecimal-number" },
{ "include": "#number-special" }
]
},
"types": {
"match": "\\b([if](32|64)|v128|funcref|externref|func|extern|func|param|result|mut)\\b",
"name": "keyword"
},
"string": {
"begin": "\"",
"end": "\"",
"name": "string.quoted",
"patterns": [
{
"name": "constant.character.escape",
"match": "\\\\[\"\\\\]"
}
]
},
"line-comment": {
"match": ";;.*$",
"name": "comment.line.double-semicolon"
},
"block-comment": {
"begin": "\\(;",
"end": ";\\)",
"name": "comment.block"
},
"expr": {
"begin": "\\(",
"end": "\\)",
"beginCaptures": {
"0": { "name": "punctuation.paren.open" }
},
"endCaptures": {
"0": { "name": "punctuation.paren.close" }
},
"name": "expression.group",
"patterns": [
{ "include": "#block-comment" },
{ "include": "$self" },
{ "include": "#types" },
{ "include": "#line-comment" },
{ "include": "#any-number" },
{ "include": "#memarg" },
{ "include": "#id" },
{ "include": "#string" },
{ "include": "#op" }
]
}
}
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long