PrimeIntellect/SWE-rebench-V2 huggingface dataset:
Repository: swc-project/swc (rust)

Issue:
[TypeScript] Invalid code generated of `var` declaration which shares the name of exported binding
### Describe the bug

The `Pat` in declaration name should be skipped in `RefRewriter`.

### Input code

```typescript
namespace Foo {
    export var a = 1;
    for (var a; a < 5; a++) {}
}
```


### Config

```json
{
  "jsc": {
    "parser": {
      "syntax": "typescript"
    },
    "target": "es2022",
  },
  "module": {
    "type": "commonjs"
  },
  "isModule": true
}
```


### Playground link (or link to the minimal reproduction)

https://play.swc.rs/?version=1.3.92&code=H4sIAAAAAAAAA8tLzE0tLkhMTlVwy89XqOZSAILUioL8ohKFssQihUQFWwVDa7BoWn6RggZYzBoobKNgCqS0tTUVqmu5arkAbZ%2FyMEcAAAA%3D&config=H4sIAAAAAAAAA0WMSwqAMAxE9z1FydqFdOkdPESpQRT7IYmgiHe3rVh3mTcvcymtYWUHg77ymUOyxEgtZ8JnEHtkAnImZEdLEqjl3b0%2FYmlGKQay6Y2BwmsJPk77hv98mSiii97HsDI0c%2BHxc4V2VPcDPflySJwAAAA%3D

### SWC Info output

_No response_

### Expected behavior

```JavaScript 
"use strict";
var Foo;
(function(Foo) {
    Foo.a = 1;
    for(var a; Foo.a < 5; Foo.a++){}
})(Foo || (Foo = {}));
```

### Actual behavior

```JavaScript 
"use strict";
var Foo;
(function(Foo) {
    Foo.a = 1;
    for(var Foo.a; Foo.a < 5; Foo.a++){}
})(Foo || (Foo = {}));
```

### Version

1.3.92

### Additional context

_No response_

Pull request:
fix(es/utils): Skip var declarator name in `RefRewriter`
**Related issue:**
 - Closes #8124 

Patch:
diff --git a/crates/swc_ecma_utils/src/lib.rs b/crates/swc_ecma_utils/src/lib.rs
index a63155ac78..d11260ccc0 100644
--- a/crates/swc_ecma_utils/src/lib.rs
+++ b/crates/swc_ecma_utils/src/lib.rs
@@ -3062,6 +3062,11 @@ where
         }
     }
 
+    fn visit_mut_var_declarator(&mut self, n: &mut VarDeclarator) {
+        // skip var declarator name
+        n.init.visit_mut_with(self);
+    }
+
     fn visit_mut_pat(&mut self, n: &mut Pat) {
         match n {
             Pat::Ident(BindingIdent { id, .. }) => {


Test patch:
diff --git a/crates/swc_ecma_transforms_typescript/tests/fixture/issue-8124/input.ts b/crates/swc_ecma_transforms_typescript/tests/fixture/issue-8124/input.ts
new file mode 100644
index 0000000000..65c9594d6d
--- /dev/null
+++ b/crates/swc_ecma_transforms_typescript/tests/fixture/issue-8124/input.ts
@@ -0,0 +1,9 @@
+namespace Foo {
+    export var a = 1;
+    for (var a; a < 5; a++) {}
+}
+
+namespace Bar {
+    export var b = 2;
+    var b = 3;
+}
diff --git a/crates/swc_ecma_transforms_typescript/tests/fixture/issue-8124/output.js b/crates/swc_ecma_transforms_typescript/tests/fixture/issue-8124/output.js
new file mode 100644
index 0000000000..17dbfedca3
--- /dev/null
+++ b/crates/swc_ecma_transforms_typescript/tests/fixture/issue-8124/output.js
@@ -0,0 +1,10 @@
+var Foo;
+(function(Foo) {
+    Foo.a = 1;
+    for(var a; Foo.a < 5; Foo.a++){}
+})(Foo || (Foo = {}));
+var Bar;
+(function(Bar) {
+    Bar.b = 2;
+    var b = 3;
+})(Bar || (Bar = {}));
Repository: manusa/electronim (js)

Issue:
Dialog auto-resize should be disabled
## Description

The dialog Electorn auto-resize feature should be disabled. Auto-resizing is handled internally by ElectronIM and should not be delegated to Electron's built-in behavior.

The following code:
https://github.com/manusa/electronim/blob/bcb5760d80dd00ec51055e1c404c02ff55eed874/src/browser-window/index.js#L20

Should be replaced by:
```javascript
  browserView.setAutoResize({width: false, horizontal: false, height: false, vertical: false});
```

The test should be updated accordingly too:
https://github.com/manusa/electronim/blob/bcb5760d80dd00ec51055e1c404c02ff55eed874/src/browser-window/__tests/index.test.js#L39-L40

Pull request:
Chore: disable dialog auto resize #128
Fix #128 

Patch:
diff --git a/package.json b/package.json
index 92040d3..cbc4dfd 100644
--- a/package.json
+++ b/package.json
@@ -206,5 +206,8 @@
     "markdown-it": "13.0.1",
     "nodehun": "3.0.2",
     "preact": "10.11.0"
+  },
+  "directories": {
+    "doc": "docs"
   }
 }
diff --git a/src/browser-window/index.js b/src/browser-window/index.js
index 2aece89..b04e243 100644
--- a/src/browser-window/index.js
+++ b/src/browser-window/index.js
@@ -17,7 +17,7 @@ const showDialog = (window, browserView) => {
   window.setBrowserView(browserView);
   const {width, height} = window.getContentBounds();
   browserView.setBounds({x: 0, y: 0, width, height});
-  browserView.setAutoResize({width: true, horizontal: true, height: true, vertical: true});
+  browserView.setAutoResize({width: false, horizontal: false, height: false, vertical: false});
 };
 
 module.exports = {showDialog};


Test patch:
diff --git a/src/browser-window/__tests__/index.test.js b/src/browser-window/__tests__/index.test.js
index 6426048..87f91b8 100644
--- a/src/browser-window/__tests__/index.test.js
+++ b/src/browser-window/__tests__/index.test.js
@@ -37,6 +37,6 @@ describe('browser-window util module test suite', () => {
     expect(dialog.setBounds).toHaveBeenCalledWith({x: 0, y: 0, width: 13, height: 37});
     expect(dialog.setAutoResize).toHaveBeenCalledTimes(1);
     expect(dialog.setAutoResize)
-      .toHaveBeenCalledWith({width: true, horizontal: true, height: true, vertical: true});
+      .toHaveBeenCalledWith({width: false, horizontal: false, height: false, vertical: false});
   });
 });
Repository: google/go-safeweb (go)

Issue:
All registered paths call the same handler
Buggy place: https://github.com/google/go-safeweb/blob/0c2edce93f20a51c77af2057b966ab5530e2114e/safehttp/mux.go#L75.

The closure passed to `mux.HandleFunc` captures local loop variables, making each instance of `handlersPerMethod` point to the same `map`. Oops.

Pull request:
Fix Handler registering mixup.
Fixes #240.

Patch:
diff --git a/safehttp/mux.go b/safehttp/mux.go
index fb41b1b..5dd1ae6 100644
--- a/safehttp/mux.go
+++ b/safehttp/mux.go
@@ -72,6 +72,7 @@ type ServeMux struct {
 
 func registerHandlers(mux *http.ServeMux, handlers map[string]map[string]HandlerConfig) {
 	for pattern, handlersPerMethod := range handlers {
+		handlersPerMethod := handlersPerMethod
 		mux.HandleFunc(pattern, func(w http.ResponseWriter, r *http.Request) {
 			cfg, ok := handlersPerMethod[r.Method]
 			if !ok {


Test patch:
diff --git a/safehttp/mux_test.go b/safehttp/mux_test.go
index 68dcd0c..d2571ed 100644
--- a/safehttp/mux_test.go
+++ b/safehttp/mux_test.go
@@ -145,6 +145,47 @@ func TestMuxServeTwoHandlers(t *testing.T) {
 	}
 }
 
+func TestMuxRegisterCorrectHandlerAllPaths(t *testing.T) {
+	var tests = []struct {
+		name     string
+		req      *http.Request
+		hf       safehttp.Handler
+		wantBody string
+	}{
+		{
+			name: "GET Handler",
+			req:  httptest.NewRequest(safehttp.MethodGet, "http://foo.com/get", nil),
+			hf: safehttp.HandlerFunc(func(w safehttp.ResponseWriter, r *safehttp.IncomingRequest) safehttp.Result {
+				return w.Write(safehtml.HTMLEscaped("GET handler for /get"))
+			}),
+			wantBody: "GET handler for /get",
+		},
+		{
+			name: "GET Handler #2",
+			req:  httptest.NewRequest(safehttp.MethodGet, "http://foo.com/get2", nil),
+			hf: safehttp.HandlerFunc(func(w safehttp.ResponseWriter, r *safehttp.IncomingRequest) safehttp.Result {
+				return w.Write(safehtml.HTMLEscaped("GET handler for /get2"))
+			}),
+			wantBody: "GET handler for /get2",
+		},
+	}
+
+	mb := &safehttp.ServeMuxConfig{}
+	mb.Handle("/get", safehttp.MethodGet, tests[0].hf)
+	mb.Handle("/get2", safehttp.MethodGet, tests[1].hf)
+	mux := mb.Mux()
+
+	for _, test := range tests {
+		b := &strings.Builder{}
+		rw := safehttptest.NewTestResponseWriter(b)
+		mux.ServeHTTP(rw, test.req)
+
+		if got, want := b.String(), test.wantBody; got != want {
+			t.Errorf("response body: got %q want %q", got, want)
+		}
+	}
+}
+
 func TestMuxHandleSameMethodTwice(t *testing.T) {
 	mb := &safehttp.ServeMuxConfig{}