8 lines
73 KiB
Text
8 lines
73 KiB
Text
|
{
|
||
|
"version": 3,
|
||
|
"sources": ["../dist/index.js", "../dist/nodes/index.js", "../dist/nodes/BaseJSNode.js", "../dist/nodes/ArrayExpression.js", "../dist/utils/index.js", "../dist/nodes/ArrowFunctionExpression.js", "../dist/nodes/AssignmentExpression.js", "../dist/nodes/BinaryExpression.js", "../dist/nodes/BlockStatement.js", "../dist/nodes/BreakStatement.js", "../dist/nodes/CallExpression.js", "../dist/nodes/ConditionalExpression.js", "../dist/nodes/ContinueStatement.js", "../dist/nodes/ExpressionStatement.js", "../dist/nodes/ForOfStatement.js", "../dist/nodes/ForStatement.js", "../dist/nodes/FunctionDeclaration.js", "../dist/nodes/FunctionExpression.js", "../dist/nodes/Identifier.js", "../dist/nodes/IfStatement.js", "../dist/nodes/Literal.js", "../dist/nodes/LogicalExpression.js", "../dist/nodes/MemberExpression.js", "../dist/nodes/NewExpression.js", "../dist/nodes/ObjectExpression.js", "../dist/nodes/Property.js", "../dist/nodes/ReturnStatement.js", "../dist/nodes/SequenceExpression.js", "../dist/nodes/SwitchCase.js", "../dist/nodes/SwitchStatement.js", "../dist/nodes/TemplateLiteral.js", "../dist/nodes/ThisExpression.js", "../dist/nodes/ThrowStatement.js", "../dist/nodes/TryStatement.js", "../dist/nodes/UnaryExpression.js", "../dist/nodes/UpdateExpression.js", "../dist/nodes/VariableDeclaration.js", "../dist/nodes/WhileStatement.js", "../dist/visitor.js", "../dist/main.js"],
|
||
|
"sourcesContent": ["import Jinter from './main.js';\nexport * as Nodes from './nodes/index.js';\nexport * as Utils from './utils/index.js';\nexport { Jinter };\nexport default Jinter;\n", "// This file is auto-generated by ./scripts/build-nodes-map.js.\nexport { default as ArrayExpression } from './ArrayExpression.js';\nexport { default as ArrowFunctionExpression } from './ArrowFunctionExpression.js';\nexport { default as AssignmentExpression } from './AssignmentExpression.js';\nexport { default as BinaryExpression } from './BinaryExpression.js';\nexport { default as BlockStatement } from './BlockStatement.js';\nexport { default as BreakStatement } from './BreakStatement.js';\nexport { default as CallExpression } from './CallExpression.js';\nexport { default as ConditionalExpression } from './ConditionalExpression.js';\nexport { default as ContinueStatement } from './ContinueStatement.js';\nexport { default as ExpressionStatement } from './ExpressionStatement.js';\nexport { default as ForOfStatement } from './ForOfStatement.js';\nexport { default as ForStatement } from './ForStatement.js';\nexport { default as FunctionDeclaration } from './FunctionDeclaration.js';\nexport { default as FunctionExpression } from './FunctionExpression.js';\nexport { default as Identifier } from './Identifier.js';\nexport { default as IfStatement } from './IfStatement.js';\nexport { default as Literal } from './Literal.js';\nexport { default as LogicalExpression } from './LogicalExpression.js';\nexport { default as MemberExpression } from './MemberExpression.js';\nexport { default as NewExpression } from './NewExpression.js';\nexport { default as ObjectExpression } from './ObjectExpression.js';\nexport { default as Property } from './Property.js';\nexport { default as ReturnStatement } from './ReturnStatement.js';\nexport { default as SequenceExpression } from './SequenceExpression.js';\nexport { default as SwitchCase } from './SwitchCase.js';\nexport { default as SwitchStatement } from './SwitchStatement.js';\nexport { default as TemplateLiteral } from './TemplateLiteral.js';\nexport { default as ThisExpression } from './ThisExpression.js';\nexport { default as ThrowStatement } from './ThrowStatement.js';\nexport { default as TryStatement } from './TryStatement.js';\nexport { default as UnaryExpression } from './UnaryExpression.js';\nexport { default as UpdateExpression } from './UpdateExpression.js';\nexport { default as VariableDeclaration } from './VariableDeclaration.js';\nexport { default as WhileStatement } from './WhileStatement.js';\n", "export default class BaseJSNode {\n constructor(node, visitor) {\n this.node = node;\n this.visitor = visitor;\n }\n run() { }\n}\n", "import BaseNode from './BaseJSNode.js';\nexport default class ArrayExpression extends BaseNode {\n run() {\n return this.node.elements.map((el) => this.visitor.visitNode(el));\n }\n}\n", "export const namedFunction = (name, fn) => Object.defineProperty(fn, 'name', { value: name });\nexport class JinterError extends Error {\n constructor(message, info) {\n super(message);\n if (info) {\n this.info = info;\n }\n }\n}\n", "import { namedFunction } from '../utils/index.js';\nimport BaseJSNode from './BaseJSNode.js';\nexport default class ArrowFunctionExpression extends BaseJSNode {\n run() {\n const { params, body } = this.node;\n // @TODO: Handle other types of params and pass them directly to next node instead of saving them in the global scope\n const fn = namedFunction('anonymous function', (args) => {\n let index = 0;\n for (const param of params) {\n this.visitor.visitNode(param);\n if (param.type === 'Identifier') {\n this.visitor.scope.set(param.name, args[index]);\n }\n else {\n console.warn('Unhandled param type', param.type);\n }\n index++;\n }\n return this.visitor.visitNode(body);\n
|
||
|
"mappings": ";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAqB,aAArB,MAAgC;AAAA,EAC5B,YAAY,MAAM,SAAS;AACvB,SAAK,OAAO;AACZ,SAAK,UAAU;AAAA,EACnB;AAAA,EACA,MAAM;AAAA,EAAE;AACZ;;;ACLA,IAAqB,kBAArB,cAA6C,WAAS;AAAA,EAClD,MAAM;AACF,WAAO,KAAK,KAAK,SAAS,IAAI,CAAC,OAAO,KAAK,QAAQ,UAAU,EAAE,CAAC;AAAA,EACpE;AACJ;;;ACLA;AAAA;AAAA;AAAA;AAAA;AAAO,IAAM,gBAAgB,CAAC,MAAM,OAAO,OAAO,eAAe,IAAI,QAAQ,EAAE,OAAO,KAAK,CAAC;AACrF,IAAM,cAAN,cAA0B,MAAM;AAAA,EACnC,YAAY,SAAS,MAAM;AACvB,UAAM,OAAO;AACb,QAAI,MAAM;AACN,WAAK,OAAO;AAAA,IAChB;AAAA,EACJ;AACJ;;;ACNA,IAAqB,0BAArB,cAAqD,WAAW;AAAA,EAC5D,MAAM;AACF,UAAM,EAAE,QAAQ,KAAK,IAAI,KA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,UAAU,KAAK,KAAK,KAAK,MAAM;AACxD,gBAAM,OAAO,KAAK,QAAQ,UAAU,KAAK,KAAK,KAAK,QAAQ;AAC3D,iBAAO,IAAI,IAAI,MAAM;AAAA,QACzB,WACS,KAAK,KAAK,KAAK,SAAS,cAAc;AAC3C,gBAAM,SAAS,KAAK,QAAQ,UAAU,KAAK,KAA
|
||
|
"names": ["args", "_CallExpression_throwError", "_CallExpression_getCalleeString", "__classPrivateFieldGet", "_Property_init", "_Property_get", "_Property_set", "__classPrivateFieldGet", "_Visitor_getNode", "__classPrivateFieldGet"]
|
||
|
}
|