Skip to content

Commit

Permalink
Don't modify treeAdapters.default directly
Browse files Browse the repository at this point in the history
  • Loading branch information
calvinjuarez committed Jun 24, 2020
1 parent 9a5d73e commit 8f36430
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/parse5/test/location-info-parser.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,11 @@ exports['Updating node source code location (GH-314)'] = function() {
};
}
};
const adapter = Object.assign(treeAdapters.default, sourceCodeLocationSetter);
const document = parse5.parse('<!doctype><body>Testing location</body>', { adapter, sourceCodeLocationInfo: true });
const treeAdapter = Object.assign({}, treeAdapters.default, sourceCodeLocationSetter);
const document = parse5.parse('<!doctype><body>Testing location</body>', {
treeAdapter,
sourceCodeLocationInfo: true
});
const [doctype, html] = document.childNodes;
const [head, body] = html.childNodes;
const [text] = body.childNodes;
Expand Down

0 comments on commit 8f36430

Please sign in to comment.