nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: Konstantin8105/c4go
Pull request #460 (2019-06-15 19:19:38)

Debug mode: add test - size of debug data


Patch:
diff --git a/.travis.yml b/.travis.yml
index 3ce1106..63c9e00 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -16,9 +16,13 @@ env:
 
 matrix:
   include:
-    - env: SCRIPT=test CLANG=3.4
-      os: linux
-      if: branch = master
+####################################################
+# Too old
+#
+#    - env: SCRIPT=test CLANG=3.4
+#      os: linux
+#      if: branch = master
+####################################################
     - env: SCRIPT=test CLANG=3.5
       os: linux
       if: branch = master
diff --git a/tests/class.cpp b/tests/class.cpp.todo
similarity index 100%
rename from tests/class.cpp
rename to tests/class.cpp.todo
diff --git a/transpiler/declarations.go b/transpiler/declarations.go
index b08a39d..38a733e 100644
--- a/transpiler/declarations.go
+++ b/transpiler/declarations.go
@@ -730,9 +730,10 @@ func transpileVarDecl(p *program.Program, n *ast.VarDecl) (
 
 	theType, err = types.ResolveType(p, n.Type)
 	if err != nil {
-		p.AddMessage(p.GenerateWarningMessage(err, n))
+		p.AddMessage(p.GenerateWarningMessage(
+			fmt.Errorf("Unknown type used C type, because %v", err), n))
 		err = nil // Error is ignored
-		theType = "UnknownType"
+		theType = n.Type
 	}
 	typeResult = util.NewTypeIdent(theType)
 


Test patch:
diff --git a/main_test.go b/main_test.go
index 39700a5..8434629 100644
--- a/main_test.go
+++ b/main_test.go
@@ -77,6 +77,7 @@ func TestIntegrationScripts(t *testing.T) {
 		}
 		t.Run(file, func(t *testing.T) {
 
+			_ = os.Remove("debug.txt")
 			defer func() {
 				// remove debug file
 				_ = os.Remove("debug.txt")
@@ -247,7 +248,18 @@ func runCdebug(file, subFolder, stdin string, clangFlags, args []string) (string
 		_ = os.Remove(file)
 	}()
 
-	return runC(file, subFolder, stdin, clangFlags, args)
+	out, err := runC(file, subFolder, stdin, clangFlags, args)
+
+	dat, errDat := ioutil.ReadFile("debug.txt")
+	if errDat != nil {
+		return out, fmt.Errorf("%v with %v", err, errDat)
+	}
+
+	if len(dat) == 0 {
+		return out, fmt.Errorf("%v with empty debug file", err)
+	}
+
+	return out, err
 }
 
 // compile and run C code
Repository: Konstantin8105/c4go
Pull request #512 (2024-05-29 12:22:50)

init


Patch:
diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml
index 1ee6459..91c0022 100644
--- a/.github/workflows/go.yml
+++ b/.github/workflows/go.yml
@@ -11,12 +11,12 @@ jobs:
   build:
     runs-on:  ubuntu-latest
     steps:
-    - uses: actions/checkout@v2
+    - uses: actions/checkout@v4
 
     - name: Set up Go
-      uses: actions/setup-go@v2
+      uses: actions/setup-go@v5
       with:
-        go-version: 1.19.12
+        go-version: 1.22.3
 
     - name: Clang
       run: |
@@ -30,27 +30,33 @@ jobs:
           # view version
           clang --version
 
+    - name: Download
+      run: |
+          go mod download
+
     - name: Lint
       run: |
           ./scripts/lint.sh
 
+    - name: Build
+      run: |
+          go build -v
+
+    - name: Race test
+      run: |
+          go test -run=TestIntegrationScripts/tests/ctype.c -race -v -timeout=30m
+
     - name: Coverage
       run: |
           go get -u github.com/wadey/gocovmerge
           go get -u github.com/Konstantin8105/cs
           go get -u golang.org/x/sys/unix
-          TRAVIS=true ./scripts/test.sh
-          # TRAVIS=true go test -v -timeout=2h
+          go test -run=TestIntegrationScripts/tests/ctype.c -coverprofile=coverage.txt -covermode=atomic
+          # TRAVIS=true ./scripts/test.sh
 
     - name: Upload coverage to Codecov
-      env:
-        CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
-      run: include_cov=coverage.txt bash <(curl -s https://codecov.io/bash)
-
-    - name: Build
-      run: |
-          go mod download
-          go build -v
-
-    - name: Race test
-      run: go test --run=TestIntegrationScripts/tests/ctype.c -race -v -timeout=30m
+      uses: codecov/codecov-action@v4
+      with:
+          token: ${{ secrets.CODECOV_ORG_TOKEN }}
+          verbose: true # optional (default = false)
+          file: coverage.txt


Test patch:
diff --git a/scripts/test.sh b/scripts/test.sh
index b173576..e390753 100755
--- a/scripts/test.sh
+++ b/scripts/test.sh
@@ -32,9 +32,13 @@ if [ $COVERAGE_FILES != 0 ]; then
 	fi
 fi
 
-echo "End of coverage"
+# echo "" > coverage.out
+# for d in $(go list ./... | grep -v vendor); do
+#     go test -v -race -coverprofile=profile.out -covermode=atomic $d
+#     if [ -f profile.out ]; then
+#         cat profile.out >> coverage.out
+#         rm profile.out
+#     fi
+# done
 
-# check race
-go test                                       \
-	-run=TestIntegrationScripts/tests/ctype.c \
-	-race -v
+echo "End of coverage"
Repository: motemen/gore
Pull request #159 (2019-12-12 10:01:33)

set the directory to the temporary directory on :doc command
This pull request changes the directory of go doc to the temporary directory. Also ignores a warning to make the tests pass. I can't understand why `GO111MODULE=on go doc strings.Join` at home directory emits a warning to stderr.


Patch:
diff --git a/commands.go b/commands.go
index 089720d..49a851e 100644
--- a/commands.go
+++ b/commands.go
@@ -346,7 +346,11 @@ func actionDoc(s *Session, in string) error {
 	}
 
 	godoc := exec.Command("go", args...)
-	godoc.Stderr = s.stderr
+	godoc.Dir = s.tempDir
+	godoc.Env = append(os.Environ(), "GO111MODULE=on")
+	ef := newErrFilter(s.stderr)
+	godoc.Stderr = ef
+	defer ef.Close()
 
 	// TODO just use PAGER?
 	if pagerCmd := os.Getenv("GORE_PAGER"); pagerCmd != "" {
diff --git a/errfilter.go b/errfilter.go
index 9eb2947..28c67a9 100644
--- a/errfilter.go
+++ b/errfilter.go
@@ -47,6 +47,9 @@ func replaceErrMsg(p []byte) []byte {
 	if bytes.HasPrefix(p, []byte("# command-line-arguments")) {
 		return nil
 	}
+	if bytes.HasPrefix(p, []byte(`warning: pattern "all" matched no module dependencies`)) {
+		return nil
+	}
 	if i := bytes.Index(p, []byte("gore_session.go")); i >= 0 {
 		if j := bytes.IndexRune(p[i:], ' '); j >= 0 {
 			return p[i+j+1:]


Test patch:
diff --git a/errfilter_test.go b/errfilter_test.go
index 0aa23c2..ae7203b 100644
--- a/errfilter_test.go
+++ b/errfilter_test.go
@@ -36,6 +36,11 @@ func TestErrFilter(t *testing.T) {
 			"# command-line-arguments foo\n/tmp/gore_session.go:10:24: undefined: foo",
 			"undefined: foo",
 		},
+		{
+			"no module dependencies warning",
+			"warning: pattern \"all\" matched no module dependencies\nwarning: pattern \"all\" matched no module dependencie",
+			"warning: pattern \"all\" matched no module dependencie",
+		},
 	}
 	for _, tc := range testCases {
 		t.Run(tc.id, func(t *testing.T) {
Repository: motemen/gore
Pull request #169 (2020-01-11 16:07:01)

print error on import error


Patch:
diff --git a/commands.go b/commands.go
index 76da49e..0eb421e 100644
--- a/commands.go
+++ b/commands.go
@@ -106,12 +106,25 @@ func actionImport(s *Session, arg string) error {
 
 	// check if the package specified by path is importable
 	_, err := packages.Load(&packages.Config{Dir: s.tempDir}, path)
-	// the importer cannot check go mod package, skip
 	if err != nil {
 		return err
 	}
 
-	astutil.AddImport(s.fset, s.file, path)
+	var found bool
+	for _, i := range s.file.Imports {
+		if strings.Trim(i.Path.Value, `"`) == path {
+			found = true
+			break
+		}
+	}
+	if !found {
+		astutil.AddNamedImport(s.fset, s.file, "_", path)
+		_, err = s.types.Check("_tmp", s.fset, []*ast.File{s.file}, nil)
+		if err != nil && strings.Contains(err.Error(), "could not import "+path) {
+			astutil.DeleteNamedImport(s.fset, s.file, "_", path)
+			return fmt.Errorf("could not import %q", path)
+		}
+	}
 
 	return nil
 }


Test patch:
diff --git a/commands_test.go b/commands_test.go
index 41be5f3..a0bc617 100644
--- a/commands_test.go
+++ b/commands_test.go
@@ -101,6 +101,13 @@ func TestAction_Import(t *testing.T) {
 	assert.Contains(t, stdout.String(), "(func(...interface {}) (int, error))")
 	assert.Contains(t, stdout.String(), "json.Encoder")
 	assert.Equal(t, "", stderr.String())
+
+	err = s.Eval(":import invalid")
+	require.Error(t, err)
+
+	err = s.Eval("fmt.Sprint")
+	require.NoError(t, err)
+	assert.Equal(t, "import: could not import \"invalid\"\n", stderr.String())
 }
 
 func TestAction_Clear(t *testing.T) {
Repository: kiwicom/mobile
Pull request #1351 (2018-11-21 15:01:34)

Hotels: Show loader on gallery grid


Patch:
diff --git a/app/hotels/src/gallery/GalleryGridTile.js b/app/hotels/src/gallery/GalleryGridTile.js
index 0c66af65..49d3467f 100644
--- a/app/hotels/src/gallery/GalleryGridTile.js
+++ b/app/hotels/src/gallery/GalleryGridTile.js
@@ -1,7 +1,7 @@
 // @flow
 
 import * as React from 'react';
-import { NetworkImage, Touchable } from '@kiwicom/mobile-shared';
+import { NetworkImage, Touchable, IconLoading } from '@kiwicom/mobile-shared';
 
 type Props = {|
   onTilePress: (imageIndex: number) => void,
@@ -15,7 +15,7 @@ type Props = {|
 
 export default class GalleryGridTile extends React.Component<Props> {
   handleTilePress = () => this.props.onTilePress(this.props.imageIndex);
-
+  renderLoadingIndicator = () => <IconLoading />;
   render() {
     const style: Object = {
       width: this.props.width,
@@ -32,6 +32,7 @@ export default class GalleryGridTile extends React.Component<Props> {
           source={{ uri: this.props.imageUrl }}
           style={style}
           resizeMode="cover"
+          indicator={this.renderLoadingIndicator}
         />
       </Touchable>
     );
diff --git a/packages/shared/src/image/NetworkImage.js b/packages/shared/src/image/NetworkImage.js
index e9df20a4..488d361c 100644
--- a/packages/shared/src/image/NetworkImage.js
+++ b/packages/shared/src/image/NetworkImage.js
@@ -16,7 +16,7 @@ type Props = {|
   +resizeMode?:
     | 'cover' // scales the image uniformly - image will be equal or larger
     | 'contain', // scales the image uniformly - image will be equal or smaller
-  +indicator?: React.ElementType,
+  +indicator?: Function,
 |};
 
 /**


Test patch:
diff --git a/app/hotels/src/gallery/__tests__/__snapshots__/GalleryGridTile.test.js.snap b/app/hotels/src/gallery/__tests__/__snapshots__/GalleryGridTile.test.js.snap
index 9d788683..acae83c5 100644
--- a/app/hotels/src/gallery/__tests__/__snapshots__/GalleryGridTile.test.js.snap
+++ b/app/hotels/src/gallery/__tests__/__snapshots__/GalleryGridTile.test.js.snap
@@ -10,6 +10,7 @@ exports[`renders with marginEnd if not last in the row 1`] = `
   rippleColor="rgba(0, 0, 0, .32)"
 >
   <NetworkImageWithContext
+    indicator={[Function]}
     resizeMode="cover"
     source={
       Object {
@@ -38,6 +39,7 @@ exports[`renders without marginEnd if last in the row 1`] = `
   rippleColor="rgba(0, 0, 0, .32)"
 >
   <NetworkImageWithContext
+    indicator={[Function]}
     resizeMode="cover"
     source={
       Object {
Repository: vuejs/eslint-plugin-vue
Pull request #1907 (2022-05-29 10:45:22)

fix(prefer-import-from-vue): skip side-effect import in `.d.ts` files
For example, in the dts generated by unplugin-vue-components, we use `import '@vue/runtime-core'` to let TypeScript aware of the context. I guess similar cases where ppl import without names, they are probably intentional to rely on its side-effects.

https://github.com/antfu/vitesse/blob/168fe3560999b1132f4b7a4ffa0a3a67859b0ca7/src/components.d.ts

ota-meshi: Thank you for this PR!
However, prefer-import-from-vue rule is intended to prevent imports from failing in a stricter package manager.

https://github.com/vuejs/eslint-plugin-vue/issues/1780#issuecomment-1028924275

So I think we need to limit the behavior changes to `d.ts`. What do you think?

antfu: Yeah, that makes sense to me. I have updated the implementation, however I might need some help on testing against it.

Patch:
diff --git a/lib/rules/prefer-import-from-vue.js b/lib/rules/prefer-import-from-vue.js
index 2b3fc5b8..3d5a1eba 100644
--- a/lib/rules/prefer-import-from-vue.js
+++ b/lib/rules/prefer-import-from-vue.js
@@ -94,6 +94,13 @@ module.exports = {
 
     return {
       ImportDeclaration(node) {
+        // Skip imports without specifiers in `.d.ts` files
+        if (
+          node.specifiers.length === 0 &&
+          context.getFilename().endsWith('.d.ts')
+        )
+          return
+
         verifySource(node.source, () => {
           if (SUBSET_AT_VUE_MODULES.has(node.source.value)) {
             // If the module is a subset of 'vue', we can safely change it to 'vue'.


Test patch:
diff --git a/tests/lib/rules/prefer-import-from-vue.js b/tests/lib/rules/prefer-import-from-vue.js
index 64854fd8..5c87404c 100644
--- a/tests/lib/rules/prefer-import-from-vue.js
+++ b/tests/lib/rules/prefer-import-from-vue.js
@@ -22,7 +22,11 @@ tester.run('prefer-import-from-vue', rule, {
     `export * from 'vue'`,
     `import Foo from 'foo'`,
     `import { createApp } from 'vue'
-    export { createApp }`
+    export { createApp }`,
+    {
+      filename: 'test.d.ts',
+      code: `import '@vue/runtime-dom'`
+    }
   ],
   invalid: [
     {
Repository: vuejs/eslint-plugin-vue
Pull request #2149 (2023-05-08 09:27:49)

Add meta object to the plugin
This PR is similar to #2145, but this PR adds a meta object to the plugin itself.
It seems that the plugin also needs it.

https://eslint.org/docs/latest/extend/plugins#metadata-in-plugins


Patch:
diff --git a/lib/index.js b/lib/index.js
index aef60a60..879a4905 100644
--- a/lib/index.js
+++ b/lib/index.js
@@ -6,6 +6,7 @@
 'use strict'
 
 module.exports = {
+  meta: require('./meta'),
   rules: {
     'array-bracket-newline': require('./rules/array-bracket-newline'),
     'array-bracket-spacing': require('./rules/array-bracket-spacing'),
diff --git a/lib/meta.js b/lib/meta.js
new file mode 100644
index 00000000..d7006995
--- /dev/null
+++ b/lib/meta.js
@@ -0,0 +1,3 @@
+'use strict'
+const { name, version } = require('../package.json')
+module.exports = { name, version }
diff --git a/lib/processor.js b/lib/processor.js
index 4fb1a0d4..f0a89fd8 100644
--- a/lib/processor.js
+++ b/lib/processor.js
@@ -126,10 +126,7 @@ module.exports = {
 
   supportsAutofix: true,
 
-  meta: {
-    name: 'eslint-plugin-vue',
-    version: require('../package.json').version
-  }
+  meta: require('./meta')
 }
 
 /**
diff --git a/tools/update-lib-index.js b/tools/update-lib-index.js
index f57ae1e5..5a53b52b 100644
--- a/tools/update-lib-index.js
+++ b/tools/update-lib-index.js
@@ -25,6 +25,7 @@ const content = `/*
 'use strict'
 
 module.exports = {
+  meta: require('./meta'),
   rules: {
     ${rules
       .map((rule) => `'${rule.name}': require('./rules/${rule.name}')`)


Test patch:
diff --git a/tests/lib/meta.js b/tests/lib/meta.js
new file mode 100644
index 00000000..f9012ce0
--- /dev/null
+++ b/tests/lib/meta.js
@@ -0,0 +1,20 @@
+'use strict'
+
+const assert = require('assert')
+const plugin = require('../..')
+const expectedMeta = {
+  name: 'eslint-plugin-vue',
+  version: require('../../package.json').version
+}
+
+describe('Test for meta object', () => {
+  it('A plugin should have a meta object.', () => {
+    assert.deepStrictEqual(plugin.meta, expectedMeta)
+  })
+
+  for (const [name, processor] of Object.entries(plugin.processors)) {
+    it(`"${name}" processor should have a meta object.`, () => {
+      assert.deepStrictEqual(processor.meta, expectedMeta)
+    })
+  }
+})
Repository: vuejs/eslint-plugin-vue
Pull request #2303 (2023-10-27 07:30:52)

Fix require-toggle-inside-transition should respect "<slot>", "v-bind:key", attribute "appear"
fix: #2302 

Also, the following case that tansition with attribute `appear` should be valid.
```
<template>
  <Transition appear>
    <div />
  </Transition>
</template>
```


Patch:
diff --git a/lib/rules/require-toggle-inside-transition.js b/lib/rules/require-toggle-inside-transition.js
index bdbb5c2d..fc46f75f 100644
--- a/lib/rules/require-toggle-inside-transition.js
+++ b/lib/rules/require-toggle-inside-transition.js
@@ -32,9 +32,18 @@ module.exports = {
       if (utils.isCustomComponent(element)) {
         return
       }
+
+      /** @type VElement */ // @ts-expect-error
+      const parent = element.parent
+      if (utils.hasAttribute(parent, 'appear')) {
+        return
+      }
+
       if (
+        element.name !== 'slot' &&
         !utils.hasDirective(element, 'if') &&
-        !utils.hasDirective(element, 'show')
+        !utils.hasDirective(element, 'show') &&
+        !utils.hasDirective(element, 'bind', 'key')
       ) {
         context.report({
           node: element.startTag,
@@ -51,6 +60,7 @@ module.exports = {
         if (child !== node) {
           return
         }
+
         verifyInsideElement(node)
       }
     })


Test patch:
diff --git a/tests/lib/rules/require-toggle-inside-transition.js b/tests/lib/rules/require-toggle-inside-transition.js
index 0b64daaa..18a33aa3 100644
--- a/tests/lib/rules/require-toggle-inside-transition.js
+++ b/tests/lib/rules/require-toggle-inside-transition.js
@@ -57,6 +57,18 @@ tester.run('require-toggle-inside-transition', rule, {
     {
       filename: 'test.vue',
       code: '<template><transition><template v-if="show"><div /></template></transition></template>'
+    },
+    {
+      filename: 'test.vue',
+      code: '<template><transition><slot /></transition></template>'
+    },
+    {
+      filename: 'test.vue',
+      code: '<template><transition><div :key="k" /></transition></template>'
+    },
+    {
+      filename: 'test.vue',
+      code: '<template><transition appear><div /></transition></template>'
     }
   ],
   invalid: [
Repository: biwascheme/biwascheme
Pull request #345 (2024-04-26 08:48:37)

fix misparsing of chars


Patch:
diff --git a/src/system/parser.js b/src/system/parser.js
index 0aa60b7..f7c7f16 100644
--- a/src/system/parser.js
+++ b/src/system/parser.js
@@ -226,6 +226,7 @@ class Parser {
     }
     const m = this.match(/^(\w+)/);
     if (m) {
+      this.i += m[0].length;
       return m[0];
     } else {
       const c = this.txt[this.i];


Test patch:
diff --git a/test/r7rs/base.test.js b/test/r7rs/base.test.js
index b1583e4..d9f8267 100644
--- a/test/r7rs/base.test.js
+++ b/test/r7rs/base.test.js
@@ -1,5 +1,12 @@
 import { ev } from "../helper.js"
 
+describe('6.6 Characters', () => {
+  test('char<?', function(){
+    ev("(char<? #\\a #\\z)").toBe(true);
+    ev("(char<? #\\z #\\Z)").toBe(false);
+  })
+})
+
 describe('11.5 Equivalence predicates', () => {
   test('eqv?', function(){
     ev("(eqv? 'a 'a)").toBe(true);
diff --git a/test/system/parser.test.js b/test/system/parser.test.js
index dc89fc9..f67e3c2 100644
--- a/test/system/parser.test.js
+++ b/test/system/parser.test.js
@@ -139,6 +139,10 @@ describe("Parser", () => {
       expect(parse("#\\a")).toBe(Char.get("a"));
     })
 
+    test("multibyte", () => {
+      expect(parse("#\\あ")).toBe(Char.get("あ"));
+    })
+
     test("number", () => {
       expect(parse("#\\1")).toBe(Char.get("1"));
     })
Repository: Modernizr/Modernizr
Pull request #2584 (2020-07-02 19:15:38)

Add warning to the gamepad detect
Firefox is planning to make the gamepad API only accessible though HTTPS connections, I just add a warning.
[https://hacks.mozilla.org/2020/07/securing-gamepad-api/](https://hacks.mozilla.org/2020/07/securing-gamepad-api/)


Patch:
diff --git a/feature-detects/gamepad.js b/feature-detects/gamepad.js
index a7312ede..93427a80 100644
--- a/feature-detects/gamepad.js
+++ b/feature-detects/gamepad.js
@@ -5,6 +5,7 @@
   "caniuse": "gamepad",
   "authors": ["Eric Bidelman"],
   "tags": ["media"],
+  "warnings": ["In new browsers it may return false in non-HTTPS connections"],
   "notes": [{
     "name": "W3C Spec",
     "href": "https://www.w3.org/TR/gamepad/"
diff --git a/feature-detects/window/resizeobserver.js b/feature-detects/window/resizeobserver.js
new file mode 100644
index 00000000..c95e2b63
--- /dev/null
+++ b/feature-detects/window/resizeobserver.js
@@ -0,0 +1,29 @@
+/*!
+{
+  "name": "ResizeObserver",
+  "property": "resizeobserver",
+  "caniuse": "resizeobserver",
+  "tags": ["ResizeObserver"],
+  "authors": ["Christian Andersson"],
+  "notes": [{
+    "name": "W3C Spec",
+    "href": "https://www.w3.org/TR/resize-observer/"
+  }, {
+    "name": "MDN Docs",
+    "href": "https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver"
+  }, {
+    "name": "Web.dev Article",
+    "href": "https://web.dev/resize-observer/"
+  }, {
+    "name": "Digital Ocean tutorial",
+    "href": "https://www.digitalocean.com/community/tutorials/js-resize-observer"
+  }]
+}
+!*/
+
+/* DOC
+Detects support for ResizeObserver.
+*/
+define(['Modernizr'], function(Modernizr) {
+  Modernizr.addTest('resizeobserver', 'ResizeObserver' in window);
+});
diff --git a/lib/config-all.json b/lib/config-all.json
index db4cf435..60ab7d74 100644
--- a/lib/config-all.json
+++ b/lib/config-all.json
@@ -310,6 +310,7 @@
     "window/atob-btoa",
     "window/framed",
     "window/matchmedia",
+    "window/resizeobserver",
     "workers/blobworkers",
     "workers/dataworkers",
     "workers/sharedworkers",


Test patch:
diff --git a/test/browser/integration/caniuse.js b/test/browser/integration/caniuse.js
index 60259ba1..c4fabe10 100644
--- a/test/browser/integration/caniuse.js
+++ b/test/browser/integration/caniuse.js
@@ -130,6 +130,7 @@ window.caniusecb = function(caniuse) {
       queryselector: 'queryselector',
       regions: 'css-regions',
       requestanimationframe: 'requestanimationframe',
+      resizeobserver: 'resizeobserver',
       rgba: 'css3-colors',
       ruby: 'ruby',
       sandbox: 'iframe-sandbox',
Repository: Modernizr/Modernizr
Pull request #2734 (2023-12-19 21:16:55)

Added BroadcastChannel
Adding check for Broadcast Channel support.


Patch:
diff --git a/feature-detects/broadcastchannel.js b/feature-detects/broadcastchannel.js
new file mode 100644
index 00000000..acf528f7
--- /dev/null
+++ b/feature-detects/broadcastchannel.js
@@ -0,0 +1,19 @@
+/*!
+{
+  "name": "Broadcast Channel",
+  "property": "broadcastchannel",
+  "authors": ["Alex Neises (@AlexNeises)"],
+  "caniuse": "broadcastchannel",
+  "tags": ["performance", "broadcastchannel"],
+  "notes": [{
+    "name": "MDN Docs",
+    "href": "https://developer.mozilla.org/en-US/docs/Web/API/BroadcastChannel"
+  }]
+}
+!*/
+/* DOC
+Detects support for Broadcast Channels, allowing communication between different documents in different windows, tabs, frames, or iframes of the same origin.
+*/
+define(['Modernizr'], function(Modernizr) {
+  Modernizr.addTest('broadcastchannel', 'BroadcastChannel' in window);
+});
diff --git a/lib/config-all.json b/lib/config-all.json
index 3e8eb70d..a765b9f9 100644
--- a/lib/config-all.json
+++ b/lib/config-all.json
@@ -36,6 +36,7 @@
     "battery/battery",
     "battery/lowbattery",
     "blob",
+    "broadcastchannel",
     "canvas/canvas",
     "canvas/blending",
     "canvas/todataurl",


Test patch:
diff --git a/test/browser/integration/caniuse.js b/test/browser/integration/caniuse.js
index 95ff8979..a4fff5fa 100644
--- a/test/browser/integration/caniuse.js
+++ b/test/browser/integration/caniuse.js
@@ -37,6 +37,7 @@ window.caniusecb = function(caniuse) {
       boxdecorationbreak: 'css-boxdecorationbreak',
       boxshadow: 'css-boxshadow',
       boxsizing: 'css3-boxsizing',
+      broadcastchannel: 'broadcastchannel',
       canvas: 'canvas',
       canvasblending: 'canvas-blending',
       canvastext: 'canvas-text',