PrimeIntellect/SWE-rebench-V2 huggingface dataset:
Repository: yuin/gopher-lua (go)

Issue:
different behavior in io.popen function
In the C implementation of the Lua interpreter, in the io.popen function the second argument can be nil:

Lua 5.1.5  Copyright (C) 1994-2012 Lua.org, PUC-Rio:
```
> x,y = io.popen("ls", nil)
> assert(x)
> assert(y == nil)
> 
```

Gopher lua throws an exception.
gopher-lua (current master):
```
bad argument #2 to popen (string expected, got nil)
```
[affected public project](https://github.com/luarocks/luarocks/blob/bb9d7ed38a092dde2b27e2adc7b386272f2890ee/src/luarocks/fs.lua#L33)


Pull request:
popen: support nil in second argument
In the C implementation of the Lua interpreter,
in the io.popen function the second argument can be nil:

Lua 5.1.5 Copyright (C) 1994-2012 Lua.org, PUC-Rio:

> x,y = io.popen("ls", nil)
> assert(x)
> assert(y == nil)
>

Gopher lua throws an exception:
bad argument #2 to popen (string expected, got nil)

Closes #459

Patch:
diff --git a/iolib.go b/iolib.go
index b59e82b..3f5f295 100644
--- a/iolib.go
+++ b/iolib.go
@@ -658,6 +658,9 @@ func ioPopen(L *LState) int {
 	cmd := L.CheckString(1)
 	if L.GetTop() == 1 {
 		L.Push(LString("r"))
+	} else if L.GetTop() > 1 && (L.Get(2)).Type() == LTNil {
+		L.SetTop(1)
+		L.Push(LString("r"))
 	}
 	var file *LUserData
 	var err error


Test patch:
diff --git a/_glua-tests/issues.lua b/_glua-tests/issues.lua
index 514d0b7..aafb5d7 100644
--- a/_glua-tests/issues.lua
+++ b/_glua-tests/issues.lua
@@ -457,3 +457,14 @@ function test()
   assert(c == 1)
   assert(type(c) == "number")
 end
+
+-- issue #459
+function test()
+  local a, b = io.popen("ls", nil)
+  assert(a)
+  assert(b == nil)
+  local a, b = io.popen("ls", nil, nil)
+  assert(a)
+  assert(b == nil)
+end
+test()
Repository: mercurius-js/mercurius (js)

Issue:
Disabling cache breaks replaceSchema
Passing `cache: false` as Plugin option makes `buildCache` return `null`, so LRUs instances are null.

But the `replaceSchema` method does not check if LRUs are null and throws
```
TypeError: Cannot read property 'clear' of null
```

It's necessary to wrap each LRU call with an if :
```
if (lru) {
  lru.clear()
}
```

Pull request:
fix: disabling cache breaks replaceSchema
Fixes #398 

Patch:
diff --git a/index.js b/index.js
index b88d12b..9ca7bb1 100644
--- a/index.js
+++ b/index.js
@@ -256,9 +256,15 @@ const plugin = fp(async function (app, opts) {
 
     fastifyGraphQl.schema = s
 
-    lru.clear()
-    lruErrors.clear()
-    lruGatewayResolvers.clear()
+    if (lru) {
+      lru.clear()
+    }
+    if (lruErrors) {
+      lruErrors.clear()
+    }
+    if (lruGatewayResolvers) {
+      lruGatewayResolvers.clear()
+    }
   }
 
   fastifyGraphQl.extendSchema = function (s) {


Test patch:
diff --git a/test/app-decorator.js b/test/app-decorator.js
index f537ee6..7745e63 100644
--- a/test/app-decorator.js
+++ b/test/app-decorator.js
@@ -253,6 +253,64 @@ test('replaceSchema (clearing cache)', async (t) => {
   }
 })
 
+test('replaceSchema (without cache)', async (t) => {
+  const app = Fastify()
+
+  app.register(GQL, {
+    cache: false,
+    schema: makeExecutableSchema({
+      typeDefs: `
+      type Query {
+        add(x: Int, y: Int): Int
+        subtract(x: Int, y: Int): Int
+      }
+    `,
+      resolvers: {
+        Query: {
+          add: async (_, { x, y }) => x + y,
+          subtract: async (_, { x, y }) => x - y
+        }
+      }
+    })
+  })
+
+  // needed so that graphql is defined
+  await app.ready()
+
+  let query
+
+  query = '{ subtract(x: 4, y: 2) }'
+  const res = await app.graphql(query)
+
+  t.deepEqual(res, {
+    data: {
+      subtract: 2
+    }
+  })
+
+  app.graphql.replaceSchema(
+    makeExecutableSchema({
+      typeDefs: `
+      type Query {
+        add(x: Int, y: Int): Int
+      }
+    `,
+      resolvers: {
+        Query: {
+          add: async (_, { x, y }) => x + y
+        }
+      }
+    })
+  )
+
+  query = '{ subtract(x: 4, y: 2) }'
+  try {
+    await app.graphql(query)
+  } catch (err) {
+    t.equal(err.errors[0].message, 'Cannot query field "subtract" on type "Query".')
+  }
+})
+
 test('replaceSchema with makeSchemaExecutable (schema should be provided)', async (t) => {
   const app = Fastify()
Repository: domluna/JuliaFormatter.jl (julia)

Issue:
[regression] Invalid formatting change with macros in 1.0.23
With default settings, in the new `1.0.23`

```julia
x = @show @show "bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar"
```

becomes

```julia
x = @show
@show "bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar"
```

which changes the meaning of the code.

For reference, with `1.0.22` it changes to

```julia
x =
    @show @show "bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar"

```

Pull request:
close https://github.com/domluna/JuliaFormatter.jl/issues/693

Patch:
diff --git a/Project.toml b/Project.toml
index 1e3b24ea1..5f7f8dff0 100644
--- a/Project.toml
+++ b/Project.toml
@@ -1,7 +1,7 @@
 name = "JuliaFormatter"
 uuid = "98e50ef6-434e-11e9-1051-2b60c6c9e899"
 authors = ["Dominique Luna <dluna132@gmail.com>"]
-version = "1.0.23"
+version = "1.0.24"
 
 [deps]
 CSTParser = "00ebfdb7-1f24-5e51-bd34-a7502290713f"
diff --git a/src/styles/default/nest.jl b/src/styles/default/nest.jl
index 2a5f29216..44cc7728d 100644
--- a/src/styles/default/nest.jl
+++ b/src/styles/default/nest.jl
@@ -98,8 +98,6 @@ function nest!(ds::DefaultStyle, fst::FST, s::State)
         n_call!(style, fst, s)
     elseif fst.typ === MacroCall
         n_macrocall!(style, fst, s)
-    elseif fst.typ === MacroBlock
-        n_block!(style, fst, s)
     elseif fst.typ === RefN
         n_ref!(style, fst, s)
     elseif fst.typ === TypedVcat


Test patch:
diff --git a/test/issues.jl b/test/issues.jl
index ecab8f71a..0a9e07c9f 100644
--- a/test/issues.jl
+++ b/test/issues.jl
@@ -316,26 +316,16 @@
         end"""
 
         # NOTE: this looks slightly off because we're compensating for escaping quotes
-        # NOTE: updated test in light of fixing #663 which allows breaking on consecutive macrocalls
-        # Meaning "@macro1 @macro2"
-        #
-        # can be
-        #
-        # """
-        # @macro1
-        # @macro2
-        # """
         str = """
         begin
             f() do
-                @info
-                @sprintf \"\"\"
-          Δmass   = %.16e\"\"\" abs(weightedsum(Q) - weightedsum(Qe)) / weightedsum(Qe)
+                @info @sprintf \"\"\"
+                Δmass   = %.16e\"\"\" abs(weightedsum(Q) - weightedsum(Qe)) /
+                                   weightedsum(Qe)
             end
         end"""
         @test fmt(str_, m = 81) == str
-        @test fmt(str_, m = 82) == str_
-        @test fmt(str, m = 200) == str
+        @test fmt(str, m = 82) == str_
     end
 
     @testset "issue #202" begin
@@ -1537,17 +1527,6 @@
         @test fmt(s, 4, 92) == s
     end
 
-    @testset "663" begin
-        s1 = """
-        @macro1 foo @macro2 bar(a=10)
-        """
-        s2 = """
-        @macro1 foo
-        @macro2 bar(a = 10)
-        """
-        @test fmt(s1, 4, 19) == s2
-    end
-
     @testset "667" begin
         s = raw"""
         \"""