{"record":{"id":"cd9e09ef3e53a3ad","repo":"ssssssss-team/spider-flow","slug":"this-is-abstract-class","errorCode":null,"errorMessage":"This is abstract class","messagePattern":"This is abstract class","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"spider-flow-web/src/main/resources/static/js/jsontree/jsontree.js","lineNumber":217,"sourceCode":"     *\r\n     * Markup:\r\n     * <li class=\"jsontree_node\">\r\n     *     <span class=\"jsontree_label-wrapper\">\r\n     *         <span class=\"jsontree_label\">\"age\"</span>\r\n     *         :\r\n     *     </span>\r\n     *     <span class=\"jsontree_value jsontree_value_(number|boolean|string|null)\">25</span>\r\n     *     ,\r\n     * </li>\r\n     *\r\n     * @abstract\r\n     * @param label {string} - key name\r\n     * @param val {string | number | boolean | null} - a value of simple types\r\n     * @param isLast {boolean} - true if node is last in list of parent childNodes\r\n     */\r\n    function _NodeSimple(label, val, isLast) {\r\n        if (this.constructor === _NodeSimple) {\r\n            throw new Error('This is abstract class');\r\n        }\r\n        \r\n        var self = this,\r\n            el = document.createElement('li'),\r\n            labelEl,\r\n            template = function(label, val) {\r\n                var str = '\\\r\n                    <span class=\"jsontree_label-wrapper\">\\\r\n                        <span class=\"jsontree_label\">\"' +\r\n                            label +\r\n                        '\"</span> : \\\r\n                    </span>\\\r\n                    <span class=\"jsontree_value-wrapper\">\\\r\n                        <span class=\"jsontree_value jsontree_value_' + self.type + '\">' +\r\n                            val +\r\n                        '</span>' +\r\n                        (!isLast ? ',' : '') + \r\n                    '</span>';\r","sourceCodeStart":199,"sourceCodeEnd":235,"githubUrl":"https://github.com/ssssssss-team/spider-flow/blob/c799cca99c7d064673dc79e6ef06a08bbc0e292d/spider-flow-web/src/main/resources/static/js/jsontree/jsontree.js#L199-L235","documentation":"jsontree.js implements _NodeSimple as an abstract base class: simple leaf node types (string, number, boolean, null) must subclass it. The constructor explicitly throws when instantiated directly (this.constructor === _NodeSimple) so that developers cannot create incomplete leaf nodes that lack the subclass's rendering behavior.","triggerScenarios":"Calling `new _NodeSimple(label, val, isLast)` directly instead of instantiating a concrete subclass such as the string/number/boolean/null node classes defined later in jsontree.js.","commonSituations":"Developers customizing the JSON tree widget call the base class directly, or copy example code that used a concrete subclass and mistakenly substitute the abstract one, or plugin code maps JSON value types to node classes and falls back to the base class for simple values.","solutions":["Instantiate the concrete node class matching the value type (e.g. the string/number/boolean/null subclasses) instead of _NodeSimple.","If a custom node type is needed, create a subclass that calls _NodeSimple.apply(this, arguments) (or .call) and only then use `new SubClass(...)`.","Search your code for `new _NodeSimple` and route it through the library's factory/registry that maps value types to node classes."],"exampleFix":"// before\nvar node = new _NodeSimple('key', value, isLast);\n// after\nvar NodeClass = getValueNodeClass(value); // concrete subclass per type\nvar node = new NodeClass('key', value, isLast);","handlingStrategy":"type-guard","validationCode":"function canCreateSimpleNode(Ctor) { return typeof Ctor === 'function' && Ctor !== _NodeSimple && Ctor.prototype instanceof _NodeSimple; }","typeGuard":"function isConcreteNodeClass(Ctor) { return typeof Ctor === 'function' && Ctor !== _NodeSimple && (Ctor.prototype instanceof _NodeSimple); }","tryCatchPattern":"try {\n  node = new NodeClass(label, val, isLast);\n} catch (e) {\n  if (e.message === 'This is abstract class') { node = getConcreteNodeClass(value); node = new node(label, val, isLast); }\n  else throw e;\n}","preventionTips":["Never instantiate classes prefixed with _ and documented as abstract in jsontree.js.","Route node creation through the library's factory that maps value types to concrete classes.","When subclassing, always call the base constructor with apply/call before use."],"tags":["javascript","abstract-class","instantiation"],"backgroundTag":"abstract-method-not-implemented","analyzedSha":"c799cca99c7d064673dc79e6ef06a08bbc0e292d","analyzedAt":"2026-09-08T13:47:08.225Z","contentChangedAt":"2026-09-08T13:47:08.225Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}