PrimeIntellect/SWE-rebench-V2 huggingface dataset:
Repository: ant-design/ant-design-mobile (ts)

Issue:
TextArea的最外层容器.adm-text-area未加position: relative;会导致auoSize异常。
### Version of antd-mobile

5.31.1

### Operating system and its version

iOS, Android

### Browser and its version

_No response_

### Sandbox to reproduce

_No response_

### What happened?

如题，你们简单修复下吧，我就不蹭PR了

### Relevant log output

_No response_

Pull request:
fix(TextArea): hidden textarea element is not positioned relative to its parent
fix #6238
这个 absolute 没比较的父级定位，换行计算错误了

![image](https://github.com/ant-design/ant-design-mobile/assets/77056991/2a7d2449-8240-41e3-aeb4-19a50848858c)


Patch:
diff --git a/src/components/text-area/text-area.less b/src/components/text-area/text-area.less
index c2c10679f..048f80f54 100644
--- a/src/components/text-area/text-area.less
+++ b/src/components/text-area/text-area.less
@@ -5,7 +5,7 @@
   --disabled-color: var(--adm-color-weak);
   --text-align: left;
   --count-text-align: right;
-
+  position: relative;
   width: 100%;
   max-width: 100%;
   max-height: 100%;
diff --git a/src/components/virtual-input/virtual-input.tsx b/src/components/virtual-input/virtual-input.tsx
index 6e764320b..11751f9fc 100644
--- a/src/components/virtual-input/virtual-input.tsx
+++ b/src/components/virtual-input/virtual-input.tsx
@@ -151,7 +151,7 @@ export const VirtualInput = forwardRef<VirtualInputRef, VirtualInputProps>(
             <CloseCircleFill />
           </div>
         )}
-        {!value && (
+        {[undefined, null, ''].includes(value) && (
           <div className={`${classPrefix}-placeholder`}>
             {props.placeholder}
           </div>


Test patch:
diff --git a/src/components/virtual-input/tests/virtual-input.test.tsx b/src/components/virtual-input/tests/virtual-input.test.tsx
index 5e12b3567..0cd11daab 100644
--- a/src/components/virtual-input/tests/virtual-input.test.tsx
+++ b/src/components/virtual-input/tests/virtual-input.test.tsx
@@ -108,4 +108,9 @@ describe('VirtualInput', () => {
       ).not.toBeVisible()
     })
   })
+
+  test('placeholder should not be shown when value is `0`', () => {
+    render(<VirtualInput value={0 as any} placeholder='placeholder' />)
+    expect(screen.queryByText('placeholder')).toBeNull()
+  })
 })
Repository: ember-cli/ember-cli (js)

Issue:
Add environment output when building
Hi, I would love to see what environment I'm building for when I run `ember b` or in general any script that will trigger run for me.

Something like this
```bash
user@bash>ember b
Building
Environment: development
.....
```

Pull request:
Prints environment in console during build
Fixes #7480

Patch:
diff --git a/lib/tasks/build-watch.js b/lib/tasks/build-watch.js
index 0e34f9545..235cc3a46 100644
--- a/lib/tasks/build-watch.js
+++ b/lib/tasks/build-watch.js
@@ -15,21 +15,25 @@ class BuildWatchTask extends Task {
   }
 
   run(options) {
-    this.ui.startProgress(
+    let { ui } = this;
+
+    ui.startProgress(
       chalk.green('Building'), chalk.green('.')
     );
 
     this._runDeferred = RSVP.defer();
 
     let builder = this._builder = options._builder || new Builder({
-      ui: this.ui,
+      ui,
       outputPath: options.outputPath,
       environment: options.environment,
       project: this.project,
     });
 
+    ui.writeLine(`Environment: ${options.environment}`);
+
     let watcher = options._watcher || new Watcher({
-      ui: this.ui,
+      ui,
       builder,
       analytics: this.analytics,
       options,
diff --git a/lib/tasks/build.js b/lib/tasks/build.js
index 0bfe1eb36..5bef3c817 100644
--- a/lib/tasks/build.js
+++ b/lib/tasks/build.js
@@ -19,6 +19,8 @@ class BuildTask extends Task {
       project: this.project,
     });
 
+    ui.writeLine(`Environment: ${options.environment}`);
+
     let annotation = {
       type: 'initial',
       reason: 'build',


Test patch:
diff --git a/tests/integration/tasks/build-test.js b/tests/integration/tasks/build-test.js
index c9ff31f24..e40e0dfbc 100644
--- a/tests/integration/tasks/build-test.js
+++ b/tests/integration/tasks/build-test.js
@@ -96,4 +96,22 @@ describe('build task test', function() {
         expect(Array.isArray(output.nodes)).to.equal(true);
       });
   });
+
+  it('it displays environment', function() {
+    let outputPath = 'dist';
+    let task = new BuildTask({
+      analytics: new MockAnalytics(),
+      project,
+      ui,
+    });
+
+    let runOptions = {
+      outputPath,
+      environment: 'development',
+    };
+
+    return task.run(runOptions).then(() => {
+      expect(ui.output).to.include('Environment: development');
+    });
+  });
 });
diff --git a/tests/unit/tasks/build-watch-test.js b/tests/unit/tasks/build-watch-test.js
index fcdae9876..c665e3b7d 100644
--- a/tests/unit/tasks/build-watch-test.js
+++ b/tests/unit/tasks/build-watch-test.js
@@ -69,6 +69,7 @@ describe('build-watch task', function() {
 
       return runPromise.then(() => {
         expect(ui.output).to.include('cleaning up...');
+        expect(ui.output).to.include('Environment: test');
       });
     });
   });
Repository: elliotchance/c2go (go)

Issue:
wide string literal not handled by regex
Error from my own test:
```
panic: could not match regexp with string
^(?P<address>[0-9a-fx]+) <(?P<position>.*)> '(?P<type>.*)'(?P<lvalue> lvalue)? (?P<value>".*")[\s]*$
0x561f897201c8 <col:16> 'wchar_t [6]' L"tes\x115t"
```
Source found on https://c-testsuite.github.io/c2go_report.html:
```c
// this file contains BMP chars encoded in UTF-8
#include <stdio.h>
#include <wchar.h>

int main()
{
    wchar_t s[] = L"hello$$你好¢¢世界€€world";
    wchar_t *p;
    for (p = s; *p; p++) printf("%04X ", (unsigned) *p);
    printf("\n");
    return 0;
}
```

Docs:
>StringLiteral - This represents a string literal expression, e.g. "foo" or L"bar" (wide strings). 

https://clang.llvm.org/doxygen/classclang_1_1StringLiteral.html

Pull request:
Handle wide-character string literals in regex
Fixes #866

Does not add support for wide-character strings per se, only for parsing the clang AST without crashing.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/elliotchance/c2go/867)
<!-- Reviewable:end -->


Patch:
diff --git a/ast/string_literal.go b/ast/string_literal.go
index 76df79a..fd4ea83 100644
--- a/ast/string_literal.go
+++ b/ast/string_literal.go
@@ -17,7 +17,7 @@ type StringLiteral struct {
 
 func parseStringLiteral(line string) *StringLiteral {
 	groups := groupsFromRegex(
-		`<(?P<position>.*)> '(?P<type>.*)'(?P<lvalue> lvalue)? (?P<value>".*")`,
+		`<(?P<position>.*)> '(?P<type>.*)'(?P<lvalue> lvalue)? L?(?P<value>".*")`,
 		line,
 	)
 


Test patch:
diff --git a/ast/string_literal_test.go b/ast/string_literal_test.go
index bea645b..4cfabbd 100644
--- a/ast/string_literal_test.go
+++ b/ast/string_literal_test.go
@@ -30,6 +30,14 @@ func TestStringLiteral(t *testing.T) {
 			Value:      "foo",
 			ChildNodes: []Node{},
 		},
+		`0x61b80c8 <col:19> 'wchar_t [21]' lvalue L"hello$$\x4F60\x597D\242\242\x4E16\x754C\x20AC\x20ACworld"`: &StringLiteral{
+			Addr:       0x61b80c8,
+			Pos:        NewPositionFromString("col:19"),
+			Type:       "wchar_t [21]",
+			Lvalue:     true,
+			Value:      "hello$$\x4F60\x597D\242\242\x4E16\x754C\x20AC\x20ACworld",
+			ChildNodes: []Node{},
+		},
 	}
 
 	runNodeTests(t, nodes)
Repository: gpbl/react-day-picker (ts)

Issue:
Selecting day on calendar with DayPickerInput and format=Array throws error
Selecting day in overlay calendar while using DayPickerInput with format=Array<string> throws error "Uncaught TypeError: format.match is not a function" from moment.js.

Traced this to moment.js parsing accepting an array of string formats to check against but moment.format() expects a single string as argument [[doc]](https://momentjs.com/docs/#/displaying/format/)

Example:
https://codesandbox.io/s/5wz092n1pk

Maybe as an easy compromise/fix when format is given as an array default to formatting by the first array element?

Pull request:
Use first element `format` (fix #491)

Patch:
diff --git a/src/DayPickerInput.js b/src/DayPickerInput.js
index 3073bd9d1..9527c839a 100644
--- a/src/DayPickerInput.js
+++ b/src/DayPickerInput.js
@@ -261,13 +261,20 @@ export default class DayPickerInput extends React.Component {
       return;
     }
 
+    const { format } = this.props;
     const m = moment(day);
-    this.setState({ value: m.format(this.props.format), month: day }, () => {
-      if (this.props.onDayChange) {
-        this.props.onDayChange(m, modifiers);
+    this.setState(
+      {
+        value: m.format(typeof format === 'string' ? format : format[0]),
+        month: day,
+      },
+      () => {
+        if (this.props.onDayChange) {
+          this.props.onDayChange(m, modifiers);
+        }
+        this.hideAfterDayClick();
       }
-      this.hideAfterDayClick();
-    });
+    );
   };
 
   renderOverlay() {


Test patch:
diff --git a/test/daypickerinput/events.js b/test/daypickerinput/events.js
index 758cee4dd..9bb4ccfb9 100644
--- a/test/daypickerinput/events.js
+++ b/test/daypickerinput/events.js
@@ -191,6 +191,24 @@ describe('DayPickerInput', () => {
         expect(onDayChange.mock.calls[0][0].format('L')).toBe('02/08/2017');
         expect(onDayChange.mock.calls[0][1]).toEqual({ foo: true });
       });
+      it('should work also when `format` is an array', () => {
+        const onDayChange = jest.fn();
+        const wrapper = mount(
+          <DayPickerInput
+            onDayChange={onDayChange}
+            format={['L', 'LL']}
+            dayPickerProps={{
+              month: new Date(2017, 1),
+            }}
+          />
+        );
+        wrapper.instance().showDayPicker();
+        wrapper
+          .find('.DayPicker-Day')
+          .at(10)
+          .simulate('click');
+        expect(onDayChange.mock.calls[0][0].format('L')).toBe('02/08/2017');
+      });
       it('should hide the day picker when clicking on a day', done => {
         const wrapper = mount(<DayPickerInput />);
         wrapper.instance().showDayPicker();
Repository: jsonata-js/jsonata (js)

Issue:
Path expression on very large object causes RangeError
When mapping over objects that contain a large number of properties (>> 100000), the evaluator throws the js error `RangeError: Maximum call stack size exceeded`.

This is a bug in the flattening logic caused by the use of `Array.prototype.push.apply` to join arrays and is related to the known issue https://github.com/nodejs/node/issues/27732.

This bit of code needs rewriting.

Pull request:
rewrite array flattening to avoid RangeError
resolves #434 

Signed-off-by: andrew-coleman <andrew_coleman@uk.ibm.com>

Patch:
diff --git a/src/functions.js b/src/functions.js
index e64d5ef..656c4ec 100644
--- a/src/functions.js
+++ b/src/functions.js
@@ -1671,7 +1671,7 @@ const functions = (() => {
                 var res =  lookup(input[ii], key);
                 if (typeof res !== 'undefined') {
                     if (Array.isArray(res)) {
-                        result.push(...res);
+                        res.forEach(val => result.push(val));
                     } else {
                         result.push(res);
                     }
diff --git a/src/jsonata.js b/src/jsonata.js
index 5924bac..aa40ccf 100644
--- a/src/jsonata.js
+++ b/src/jsonata.js
@@ -283,7 +283,7 @@ var jsonata = (function() {
                     resultSequence.push(res);
                 } else {
                     // res is a sequence - flatten it into the parent sequence
-                    Array.prototype.push.apply(resultSequence, res);
+                    res.forEach(val => resultSequence.push(val));
                 }
             });
         }


Test patch:
diff --git a/test/test-suite/groups/flattening/large.json b/test/test-suite/groups/flattening/large.json
new file mode 100644
index 0000000..a436972
--- /dev/null
+++ b/test/test-suite/groups/flattening/large.json
@@ -0,0 +1,16 @@
+[
+    {
+        "expr": "( $data := { 'number': [1..2e5].$string() }; $values := $data.number; $count($values) )",
+        "data": null,
+        "result": 200000,
+        "timelimit": 10000,
+        "depth": 10
+    },
+    {
+        "expr": "( $data := { 'number': [1..2e5].$string() }; $values := $lookup($data, 'number'); $count($values) )",
+        "data": null,
+        "result": 200000,
+        "timelimit": 10000,
+        "depth": 10
+    }
+]
Repository: infernojs/inferno (js)

Issue:
Double text in SSR when started with quote symbols
**Observed Behaviour**

Trying this code:
```js
const InfernoServer = require("inferno-server")
const createElement = require("inferno-create-element")
InfernoServer.renderToString(createElement('div', {}, '"test'))
```
Gives: 
```html
<div>"test&quot;test</div>
```
Text doubles when started with `"` or `&`  

**Expected Current Behaviour**

Should be
```html
<div>&quot;test</div>
```


**Inferno Metadata**
Was tested here: https://npm.runkit.com/


Pull request:
Issue #1191: Double text in SSR when started with quote symbols
Closes #1191
Fixed and added test for this issue

Patch:
diff --git a/packages/inferno-server/src/utils.ts b/packages/inferno-server/src/utils.ts
index d98832fde..57b88d821 100644
--- a/packages/inferno-server/src/utils.ts
+++ b/packages/inferno-server/src/utils.ts
@@ -3,8 +3,8 @@
  */ /** TypeDoc Comment */
 
 export function escapeText(text: string): string {
-  let result = text;
-  let escape: string = "";
+  let result = "";
+  let escape = "";
   let start = 0;
   let i;
   for (i = 0; i < text.length; i++) {
@@ -37,10 +37,7 @@ export function escapeText(text: string): string {
     result += escape;
     start = i + 1;
   }
-  if (start && i !== start) {
-    return result + text.slice(start, i);
-  }
-  return result;
+  return result + text.slice(start, i);
 }
 
 const uppercasePattern = /[A-Z]/g;


Test patch:
diff --git a/packages/inferno-server/__tests__/creation.spec.jsx b/packages/inferno-server/__tests__/creation.spec.jsx
index 647de8198..f43d3122c 100644
--- a/packages/inferno-server/__tests__/creation.spec.jsx
+++ b/packages/inferno-server/__tests__/creation.spec.jsx
@@ -46,6 +46,11 @@ describe("SSR Creation (JSX)", () => {
         </div>,
       result: "<div>Hello world, <!---->1<!---->2<!---->3</div>"
     },
+    {
+      description: "should render text with escaped symbols",
+      template: () => <div>"Hello world"</div>,
+      result: "<div>&quot;Hello world&quot;</div>"
+    },
     {
       description: "should render a stateless component with comments",
       template: () =>
Repository: platers/obsidian-linter (ts)

Issue:
Bug: "Capitalize headings" incorrectly capitalizes
## Describe the Bug

"Capitalize headings—first letter" rule is perhaps a bit too literal. It will capitalize the first letter even if it preceded by several other characters. This is usually not desirable. 

## How to Reproduce

### Input

`### 1.0.0-b.4`

### Expected output

`### 1.0.0-b.4`

### Actual output

`### 1.0.0-B.4`

## Device

- [ ] Desktop
- [x] Mobile

Pull request:
Fix First Letter Being Capitalized if not Preceded by Tab or Space
Fixes #484 

Changes Made:
- Added a test for the case in question and made sure that the first letter capitalization only affects a letter preceded by a space or tab.

Patch:
diff --git a/src/rules/capitalize-headings.ts b/src/rules/capitalize-headings.ts
index 1f6e37e..216f20f 100644
--- a/src/rules/capitalize-headings.ts
+++ b/src/rules/capitalize-headings.ts
@@ -117,7 +117,9 @@ export default class CapitalizeHeadings extends RuleBuilder<CapitalizeHeadingsOp
             // based on https://stackoverflow.com/a/62032796 "/\p{L}/u" accounts for all unicode letters across languages
             lines[i] = lines[i]
                 .toLowerCase()
-                .replace(/^#*\s+([^\p{L}])*([\p{L}])/u, (string) => string.toUpperCase()); // capitalize first letter of heading
+                .replace(/\s+([\p{L}])/u, (lowerCaseMatch: string) => {
+                  return lowerCaseMatch.toUpperCase();
+                }); // capitalize first letter of heading
             break;
         }
       }


Test patch:
diff --git a/__tests__/capitalize-headings.test.ts b/__tests__/capitalize-headings.test.ts
index 6d74352..34c3832 100644
--- a/__tests__/capitalize-headings.test.ts
+++ b/__tests__/capitalize-headings.test.ts
@@ -97,8 +97,7 @@ ruleTest({
         style: 'First letter',
       },
     },
-    {
-      // accounts for https://github.com/platers/obsidian-linter/issues/321
+    { // accounts for https://github.com/platers/obsidian-linter/issues/321
       testName: 'Make sure non-english letters get capitalized when they are the first letter and the rule is set to capitalize the first letter',
       before: dedent`
         # état
@@ -110,5 +109,21 @@ ruleTest({
         style: 'First letter',
       },
     },
+    { // accounts for https://github.com/platers/obsidian-linter/issues/484
+      testName: 'Make sure that first letter ot be capitalized by `First Letter` is preceded by a space or tab',
+      before: dedent`
+        ### 1.0.0-b.4
+        ### b
+        # 1.0-b this is a heading
+      `,
+      after: dedent`
+        ### 1.0.0-b.4
+        ### B
+        # 1.0-b This is a heading
+      `,
+      options: {
+        style: 'First letter',
+      },
+    },
   ],
 });
Repository: sindresorhus/query-string (js)

Issue:
URIError: malformed URI sequence
When you reload a page with a URL having the form '?q=%'  an error occurs **URIError: malformed URI sequence** 

Solution: 

`        try {
            val = val === undefined ? null : decodeURIComponent(val);
        } catch (e) {
            val = null;
        }`

Is it correct?


Pull request:
Add better component decoder - fixes #98
This is another approach in order to solve #98 and PR #97. It uses [`decode-uri-component`](https://github.com/SamVerschueren/decode-uri-component) which doesn't throw an error when it fails to decode. It tries to decode as much from the input as possible. Most of the time, it uses the native `decodeURIComponent`. Only when that one fails (edge cases for instance), a custom decoder is being used.

Should we document this somewhere?

---

Fixes #98 
Fixes #97 

Patch:
diff --git a/index.js b/index.js
index 2d22df2..37c4853 100644
--- a/index.js
+++ b/index.js
@@ -1,6 +1,7 @@
 'use strict';
 var strictUriEncode = require('strict-uri-encode');
 var objectAssign = require('object-assign');
+var decodeComponent = require('decode-uri-component');
 
 function encoderForArrayFormat(opts) {
 	switch (opts.arrayFormat) {
@@ -144,9 +145,9 @@ exports.parse = function (str, opts) {
 
 		// missing `=` should be `null`:
 		// http://w3.org/TR/2012/WD-url-20120524/#collect-url-parameters
-		val = val === undefined ? null : decodeURIComponent(val);
+		val = val === undefined ? null : decodeComponent(val);
 
-		formatter(decodeURIComponent(key), val, ret);
+		formatter(decodeComponent(key), val, ret);
 	});
 
 	return Object.keys(ret).sort().reduce(function (result, key) {
diff --git a/package.json b/package.json
index f3cc9d1..6bded60 100644
--- a/package.json
+++ b/package.json
@@ -34,6 +34,7 @@
     "decode"
   ],
   "dependencies": {
+    "decode-uri-component": "^0.2.0",
     "object-assign": "^4.1.0",
     "strict-uri-encode": "^1.0.0"
   },
diff --git a/readme.md b/readme.md
index f8ac0da..51216be 100644
--- a/readme.md
+++ b/readme.md
@@ -56,6 +56,8 @@ Parse a query string into an object. Leading `?` or `#` are ignored, so you can
 
 The returned object is created with [`Object.create(null)`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/create) and thus does not have a `prototype`.
 
+URI components are decoded with [`decode-uri-component`](https://github.com/SamVerschueren/decode-uri-component).
+
 #### arrayFormat
 
 Type: `string`<br>


Test patch:
diff --git a/test/parse.js b/test/parse.js
index d1561ef..c2af489 100644
--- a/test/parse.js
+++ b/test/parse.js
@@ -169,3 +169,8 @@ test('circuit original -> parse - > stringify -> sorted original', t => {
 
 	t.deepEqual(fn.stringify(fn.parse(original, options), options), sortedOriginal);
 });
+
+test('decode keys and values', t => {
+	t.deepEqual(fn.parse('st%C3%A5le=foo'), {ståle: 'foo'});
+	t.deepEqual(fn.parse('foo=%7B%ab%%7C%de%%7D+%%7Bst%C3%A5le%7D%'), {foo: '{%ab%|%de%} %{ståle}%'});
+});