diff --git a/Atom/src/OnigRegexpExtension.mm b/Atom/src/OnigRegexpExtension.mm index 4cba51416..0d95259be 100644 --- a/Atom/src/OnigRegexpExtension.mm +++ b/Atom/src/OnigRegexpExtension.mm @@ -67,14 +67,7 @@ public: } } - if (currentIndex == 0) { - CefRefPtr tuple = CefV8Value::CreateArray(); - tuple->SetValue(0, CefV8Value::CreateString([[result stringAt:0] UTF8String])); - tuple->SetValue(1, tree); - return tuple; - } else { - return tree; - } + return tree; } CefRefPtr CaptureCount() { diff --git a/spec/stdlib/onig-reg-exp-spec.coffee b/spec/stdlib/onig-reg-exp-spec.coffee index 26619e8ea..5cb805f0f 100644 --- a/spec/stdlib/onig-reg-exp-spec.coffee +++ b/spec/stdlib/onig-reg-exp-spec.coffee @@ -13,11 +13,10 @@ describe "OnigRegExp", -> expect(result).toBeNull() describe ".getCaptureTree(string, index)", -> - fit "returns match with nested capture groups organized into a tree", -> + it "returns match with nested capture groups organized into a tree", -> regex = new OnigRegExp("a((bc)d)e(f(g)(h))(?=ij)") - [text, tree] = regex.getCaptureTree("abcdefghij") + tree = regex.getCaptureTree("abcdefghij") - expect(text).toBe "abcdefgh" expect(tree).toEqual [ 0, 0, 8 [1, 1, 4, [2, 1, 3]],