Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Monster
Manage
Activity
Members
Plan
Jira
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OSS
Libraries
Javascript
Monster
Commits
f89e0343
Verified
Commit
f89e0343
authored
10 months ago
by
Volker Schukai
Browse files
Options
Downloads
Patches
Plain Diff
fix: if the query is empty but astring, getSlottedElements must not report an error #208
parent
0b824983
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
source/dom/slotted.mjs
+10
-6
10 additions, 6 deletions
source/dom/slotted.mjs
with
10 additions
and
6 deletions
source/dom/slotted.mjs
+
10
−
6
View file @
f89e0343
...
...
@@ -103,15 +103,19 @@ function getSlottedElements(query, name) {
if
(
!
(
node
instanceof
HTMLElement
))
return
;
if
(
isString
(
query
))
{
node
.
querySelectorAll
(
query
).
forEach
(
function
(
n
)
{
result
.
add
(
n
);
});
if
(
node
.
matches
(
query
))
{
if
(
query
.
length
>
0
)
{
node
.
querySelectorAll
(
query
).
forEach
(
function
(
n
)
{
result
.
add
(
n
);
});
if
(
node
.
matches
(
query
))
{
result
.
add
(
node
);
}
}
else
{
result
.
add
(
node
);
}
}
else
if
(
query
!==
undefined
)
{
throw
new
Error
(
"
query must be a string
"
);
throw
new
Error
(
"
query must be a string
and not empty
"
);
}
else
{
result
.
add
(
node
);
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment