Skip to content

Commit

Permalink
fix: x3d defs caching
Browse files Browse the repository at this point in the history
If we use this parser for multiple files with identical DEF signatures this caching will remove necessary definitions for the x3d.

Now it will be empty for every new parser.
  • Loading branch information
christopher-krause authored Apr 26, 2024
1 parent f6d5286 commit 8d372de
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/io/x3d-deserializer/src/parse.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ let x3dDefinition = x3dTypes.X3D // what kind of object beinging created

// high level elements / definitions
const x3dObjects = [] // list of objects
const x3dDefs = new Map() // list of named objects

const x3dMaterials = [] // list of materials
const x3dTextures = [] // list of textures
Expand Down Expand Up @@ -110,6 +109,7 @@ const getObjectId = () => ('0000' + objectId++).slice(-4)
const createX3DParser = (src, pxPmm) => {
// create a parser for the XML
const parser = new saxes.SaxesParser()
const x3dDefs = new Map() // list of named objects

parser.on('error', (e) => {
console.log(`error: line ${e.line}, column ${e.column}, bad character [${e.c}]`)
Expand Down

0 comments on commit 8d372de

Please sign in to comment.