Skip to content

Commit 246252a

Browse files
committedApr 26, 2023
chore: revert previous CVE fix
1 parent b856cb8 commit 246252a

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed
 

‎src/parser.coffee

+5-5
Original file line numberDiff line numberDiff line change
@@ -102,12 +102,12 @@ class exports.Parser extends events
102102
charkey = @options.charkey
103103

104104
@saxParser.onopentag = (node) =>
105-
obj = Object.create(null)
105+
obj = {}
106106
obj[charkey] = ""
107107
unless @options.ignoreAttrs
108108
for own key of node.attributes
109109
if attrkey not of obj and not @options.mergeAttrs
110-
obj[attrkey] = Object.create(null)
110+
obj[attrkey] = {}
111111
newValue = if @options.attrValueProcessors then processItem(@options.attrValueProcessors, node.attributes[key], key) else node.attributes[key]
112112
processedKey = if @options.attrNameProcessors then processItem(@options.attrNameProcessors, key) else key
113113
if @options.mergeAttrs
@@ -163,7 +163,7 @@ class exports.Parser extends events
163163
# put children into <childkey> property and unfold chars if necessary
164164
if @options.explicitChildren and not @options.mergeAttrs and typeof obj is 'object'
165165
if not @options.preserveChildrenOrder
166-
node = Object.create(null)
166+
node = {}
167167
# separate attributes
168168
if @options.attrkey of obj
169169
node[@options.attrkey] = obj[@options.attrkey]
@@ -181,7 +181,7 @@ class exports.Parser extends events
181181
# append current node onto parent's <childKey> array
182182
s[@options.childkey] = s[@options.childkey] or []
183183
# push a clone so that the node in the children array can receive the #name property while the original obj can do without it
184-
objClone = Object.create(null)
184+
objClone = {}
185185
for own key of obj
186186
objClone[key] = obj[key]
187187
s[@options.childkey].push objClone
@@ -198,7 +198,7 @@ class exports.Parser extends events
198198
if @options.explicitRoot
199199
# avoid circular references
200200
old = obj
201-
obj = Object.create(null)
201+
obj = {}
202202
obj[nodeName] = old
203203

204204
@resultObject = obj

0 commit comments

Comments
 (0)
Please sign in to comment.