Skip to content

Commit 6cc9d53

Browse files
committed
Fix Issue #19
1 parent 6fcc8b2 commit 6cc9d53

File tree

8 files changed

+6532
-6488
lines changed

8 files changed

+6532
-6488
lines changed

distribution/CsQuery.XML

Lines changed: 6506 additions & 6486 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

distribution/CsQuery.dll

512 Bytes
Binary file not shown.

distribution/CsQuery.pdb

144 KB
Binary file not shown.

source/CsQuery.Tests/Arrays.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ public static implicit operator Arrays(string members)
2121
public Arrays(string members)
2222
{
2323
InnerList = new List<string>(members.SplitClean(','));
24+
2425
}
2526
protected IEnumerable<string> InnerList;
2627

source/CsQuery.Tests/Csharp/Attributes/Attributes.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ namespace CsQuery.Tests.Csharp.Attributes
1717
[TestClass,TestFixture]
1818
public class Attribute : CsQueryTest
1919
{
20+
21+
2022
[TestMethod,Test]
2123
public void Show()
2224
{

source/CsQuery.Tests/Csharp/Selectors/PseudoSelectorsJquery.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,22 @@ public void Header()
115115
Assert.AreEqual(39, res.Length);
116116
}
117117

118+
/// <summary>
119+
/// Issue #19: error when no children
120+
/// </summary>
121+
122+
[Test, TestMethod]
123+
public void Eq()
124+
{
125+
var res = CQ.CreateFragment(@"<div class='header'>
126+
Billing Address
127+
</div>");
128+
129+
var k = res.Find("> label:visible:eq(0)");
130+
131+
Assert.AreEqual(0, k.Length);
132+
}
133+
118134
#region Setup
119135
public override void FixtureSetUp()
120136
{

source/CsQuery/Documentation/Changes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This is an informal log of changes to the project; major issues will be logged a
44

55

66
####7/17/2012
7-
7+
- Bugfix - Issue #17 - non-matching Eq() throws exception
88
- Bugfix - update `FastActivator.CreateInstance` to handle value types by deferring to `Activator.CreateInstance`. Introduced in 1.1.3.
99

1010
####7/13/2012

source/CsQuery/Engine/PseudoClassSelectors/jQuery/Eq.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,15 @@ public class Eq : Indexed
1515

1616
public override IEnumerable<IDomObject> Filter(IEnumerable<IDomObject> selection)
1717
{
18-
yield return ElementAtIndex(selection, Index);
18+
IDomObject el = ElementAtIndex(selection, Index);
19+
if (el != null)
20+
{
21+
yield return el;
22+
}
1923
}
2024

2125

26+
2227
private IDomObject ElementAtIndex(IEnumerable<IDomObject> list, int index)
2328
{
2429
if (index < 0)

0 commit comments

Comments
 (0)