nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: FontoXML/fontoxpath
Pull request #476 (2022-02-25 07:59:17)

Allow parsing XQuery modules
There was a small bug: a nullref when you'd parse an XQuery module directly

bundlemon[bot]: <!-- bundlemon -->
## BundleMon

  
  
  
  
  
  
  
<details>
<summary>Unchanged files (2)</summary>

Status | Path | Size | Limits
:------------: | ------------ | :------------: | :------------:
:white_check_mark: | fontoxpath.esm.js<br/> | 81.4KB | -
:white_check_mark: | fontoxpath.js<br/> | 81.29KB | -
</details>



Total files change +16B +0.01%

Final result: :white_check_mark:

[View report in BundleMon website ➡️](https://app.bundlemon.dev/projects/609024effb87a20009a6b096/reports/62188cce7186e22f3d90761c)

---
<p align="center"><a href="https://app.bundlemon.dev/projects/609024effb87a20009a6b096/reports?branch=parse-module&resolution=all" target="_blank" rel="noreferrer noopener">Current branch size history</a> | <a href="https://app.bundlemon.dev/projects/609024effb87a20009a6b096/reports?branch=master&resolution=days" target="_blank" rel="noreferrer noopener">Target branch size history</a></p>

Patch:
diff --git a/src/parseScript.ts b/src/parseScript.ts
index 5e334161..ae026e9d 100644
--- a/src/parseScript.ts
+++ b/src/parseScript.ts
@@ -229,7 +229,17 @@ export default function parseScript<TElement extends Element>(
 		options['functionNameResolver'] || (() => null)
 	);
 	const rootStaticContext = new StaticContext(executionSpecificStaticContext);
-	const prolog = astHelper.followPath(ast, ['mainModule', 'prolog']);
+	const anyModuleDecl = astHelper.getFirstChild(ast, ['mainModule', 'libraryModule']);
+	// Spike the static context if we are actually a library module
+	const moduleDecl = astHelper.getFirstChild(anyModuleDecl, 'moduleDecl');
+	if (moduleDecl) {
+		const prefix = astHelper.getTextContent(astHelper.getFirstChild(moduleDecl, 'prefix'));
+		const uri = astHelper.getTextContent(astHelper.getFirstChild(moduleDecl, 'uri'));
+
+		rootStaticContext.registerNamespace(prefix, uri);
+	}
+
+	const prolog = astHelper.getFirstChild(anyModuleDecl, 'prolog');
 
 	if (prolog) {
 		processProlog(prolog, rootStaticContext, false);


Test patch:
diff --git a/test/specs/parsing/parseScript.tests.ts b/test/specs/parsing/parseScript.tests.ts
index 5b77a862..8e612ae6 100644
--- a/test/specs/parsing/parseScript.tests.ts
+++ b/test/specs/parsing/parseScript.tests.ts
@@ -244,6 +244,22 @@ some-function#0()
 		chai.assert.equal(document.documentElement.outerHTML, '<baz><foo>bar</foo></baz>');
 	});
 
+	it('can parse an XQuery module', () => {
+		const document = new Document();
+		const ast = parseScript(
+			`module namespace prefix = "http://www.example.com/";
+
+declare %public function prefix:ok() as xs:string {
+	"ok"
+};
+`,
+			{},
+			document
+		);
+
+		chai.assert.isOk(ast);
+	});
+
 	it('can execute a map function within an AST', () => {
 		const ast = parseScript('map:put($week, "1", "Monday")', {}, new Document());
 		const result = evaluateXPathToMap(ast, null, null, {
Repository: styleguidist/react-styleguidist
Pull request #887 (2018-03-23 05:16:20)

Fix the bug when section name is not english
Fix the bug when section name is not english such as chinese, then switch router will be failed.

![image](https://user-images.githubusercontent.com/5652404/37812528-805e8b32-2e9b-11e8-85c0-dd8065ed13ae.png)

repeat step:
1. set option `pagePerSection: true`
2. change some section name to chinese like `测试`
3. click the link to the section
4. click other section link
5. click the chinese section again


Patch:
diff --git a/src/utils/getInfoFromHash.js b/src/utils/getInfoFromHash.js
index 87df60e9..bd3ac477 100644
--- a/src/utils/getInfoFromHash.js
+++ b/src/utils/getInfoFromHash.js
@@ -14,7 +14,7 @@ export default function getInfoFromHash(hash) {
 		const tokens = hash.substr(3).split('/');
 		const index = parseInt(tokens[1], 10);
 		return {
-			targetName: tokens[0],
+			targetName: decodeURIComponent(tokens[0]),
 			targetIndex: isNaN(index) ? undefined : index,
 		};
 	}


Test patch:
diff --git a/src/utils/__tests__/getInfoFromHash.spec.js b/src/utils/__tests__/getInfoFromHash.spec.js
index d5b7253a..c2e17fdf 100644
--- a/src/utils/__tests__/getInfoFromHash.spec.js
+++ b/src/utils/__tests__/getInfoFromHash.spec.js
@@ -10,4 +10,9 @@ describe('getInfoFromHash', () => {
 		const result = getInfoFromHash('Button');
 		expect(result).toEqual({});
 	});
+
+	it('should return the decoded targetName when router name is not English such as Chinese', () => {
+		const result = getInfoFromHash('#!/Api%20%E7%BB%84%E4%BB%B6');
+		expect(result).toEqual({ targetName: 'Api 组件', targetIndex: undefined });
+	});
 });
Repository: styleguidist/react-styleguidist
Pull request #1311 (2019-03-07 12:27:26)

typo(comment): text
English


Patch:
diff --git a/src/client/utils/rewriteImports.js b/src/client/utils/rewriteImports.js
index 76f1acd1..139e10d5 100644
--- a/src/client/utils/rewriteImports.js
+++ b/src/client/utils/rewriteImports.js
@@ -45,7 +45,7 @@ export default function(str, fn = 'require') {
 	num = 0;
 	return str
 		.replace(NAMED, (_, asterisk, base, req, dep) =>
-			generate(req ? req.split(',') : [], dep, base, fn)
+			generate(req ? req.split(',').filter(dep => dep.trim()) : [], dep, base, fn)
 		)
 		.replace(UNNAMED, (_, dep) => `${fn}('${dep}');`);
 }
diff --git a/src/loaders/utils/client/requireInRuntime.js b/src/loaders/utils/client/requireInRuntime.js
index bdb5acd9..165ae8d6 100644
--- a/src/loaders/utils/client/requireInRuntime.js
+++ b/src/loaders/utils/client/requireInRuntime.js
@@ -5,7 +5,7 @@ type RequireMap = { [filepath: string]: Module };
 
 /**
  * Return module from a given map (like {react: require('react')}) or throw.
- * We allow to require modules only from Markdown examples (won’t work dynamically becasue we need to know all required
+ * We allow to require modules only from Markdown examples (won’t work dynamically because we need to know all required
  * modules in advance to be able to bundle them with the code).
  */
 export default function requireInRuntime(requireMap: RequireMap, filepath: string): Module {


Test patch:
diff --git a/src/client/utils/__tests__/transpileImports.spec.js b/src/client/utils/__tests__/transpileImports.spec.js
index 6fa8be48..c8e3f200 100644
--- a/src/client/utils/__tests__/transpileImports.spec.js
+++ b/src/client/utils/__tests__/transpileImports.spec.js
@@ -57,6 +57,34 @@ const E = snake$0.default || snake$0;
 `);
 	});
 
+	test('transpile multiline named imports without trailing comma', () => {
+		const result = transpileImports(`import {
+  B,
+  C
+} from 'cat'
+`);
+		expect(result).toMatchInlineSnapshot(`
+"const cat$0 = require('cat');
+const B = cat$0.B;
+const C = cat$0.C;
+"
+`);
+	});
+
+	test('transpile multiline named imports with trailing comma', () => {
+		const result = transpileImports(`import {
+  B,
+  C,
+} from 'cat'
+`);
+		expect(result).toMatchInlineSnapshot(`
+"const cat$0 = require('cat');
+const B = cat$0.B;
+const C = cat$0.C;
+"
+`);
+	});
+
 	test('return code if there are no imports', () => {
 		const code = `<Button />`;
 		const result = transpileImports(code);
Repository: styleguidist/react-styleguidist
Pull request #1364 (2019-05-17 07:53:39)

Fix headers conflict with navigation link IDs
Add `section` prefix to all auto generated headings
So links to components and sections will be
`section-introduction`, `section-color` etc.

iss: #1342


Patch:
diff --git a/src/loaders/utils/getSections.js b/src/loaders/utils/getSections.js
index 05845ee0..9d1bbdd1 100644
--- a/src/loaders/utils/getSections.js
+++ b/src/loaders/utils/getSections.js
@@ -65,7 +65,7 @@ function processSection(section, config, parentDepth) {
 		usageMode: section.usageMode || config.usageMode,
 		sectionDepth,
 		description: section.description,
-		slug: slugger.slug(section.name),
+		slug: `section-${slugger.slug(section.name)}`,
 		sections: getSections(section.sections || [], config, sectionDepth),
 		filepath: contentRelativePath,
 		href: section.href,


Test patch:
diff --git a/src/loaders/utils/__tests__/__snapshots__/getSections.spec.js.snap b/src/loaders/utils/__tests__/__snapshots__/getSections.spec.js.snap
index db060d2d..57e4fa20 100644
--- a/src/loaders/utils/__tests__/__snapshots__/getSections.spec.js.snap
+++ b/src/loaders/utils/__tests__/__snapshots__/getSections.spec.js.snap
@@ -15,7 +15,7 @@ Array [
     "name": "Readme",
     "sectionDepth": 0,
     "sections": Array [],
-    "slug": "readme-1",
+    "slug": "section-readme-1",
     "usageMode": "collapse",
   },
   Object {
@@ -97,7 +97,7 @@ Array [
     "name": "Components",
     "sectionDepth": 0,
     "sections": Array [],
-    "slug": "components-1",
+    "slug": "section-components-1",
     "usageMode": "collapse",
   },
   Object {
@@ -179,7 +179,7 @@ Array [
     "name": "Ignore",
     "sectionDepth": 0,
     "sections": Array [],
-    "slug": "ignore-1",
+    "slug": "section-ignore-1",
     "usageMode": "collapse",
   },
 ]
@@ -265,7 +265,7 @@ Object {
   "name": "Components",
   "sectionDepth": 0,
   "sections": Array [],
-  "slug": "components",
+  "slug": "section-components",
   "usageMode": "collapse",
 }
 `;
@@ -284,7 +284,7 @@ Object {
   "name": "Readme",
   "sectionDepth": 0,
   "sections": Array [],
-  "slug": "readme",
+  "slug": "section-readme",
   "usageMode": "collapse",
 }
 `;
@@ -369,7 +369,7 @@ Object {
   "name": "Ignore",
   "sectionDepth": 0,
   "sections": Array [],
-  "slug": "ignore",
+  "slug": "section-ignore",
   "usageMode": "collapse",
 }
 `;
Repository: styleguidist/react-styleguidist
Pull request #1389 (2019-06-22 00:14:20)

Encode sublinks in url to fix broken routes
Follow up of https://github.com/styleguidist/react-styleguidist/issues/1332
This appears https://github.com/styleguidist/react-styleguidist/pull/1384 has fixed the top level section link,
but any sub-links within that section are still unencoded and result
in "Page not found".

![fix-sublinks-routing](https://user-images.githubusercontent.com/5443359/59956844-aa543d80-949b-11e9-8afb-9e24c4e81c30.gif)


codecov-io: # [Codecov](https://codecov.io/gh/styleguidist/react-styleguidist/pull/1389?src=pr&el=h1) Report
> Merging [#1389](https://codecov.io/gh/styleguidist/react-styleguidist/pull/1389?src=pr&el=desc) into [master](https://codecov.io/gh/styleguidist/react-styleguidist/commit/5b9b517ac3a3ee6e1360ccc9acef60d3f36727a6?src=pr&el=desc) will **increase** coverage by `<.01%`.
> The diff coverage is `100%`.

| [Impacted Files](https://codecov.io/gh/styleguidist/react-styleguidist/pull/1389?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [src/client/utils/getUrl.js](https://codecov.io/gh/styleguidist/react-styleguidist/pull/1389/diff?src=pr&el=tree#diff-c3JjL2NsaWVudC91dGlscy9nZXRVcmwuanM=) | `96.29% <100%> (+0.14%)` | :arrow_up: |


Patch:
diff --git a/src/client/utils/getUrl.js b/src/client/utils/getUrl.js
index fa0b6d80..06df8da2 100644
--- a/src/client/utils/getUrl.js
+++ b/src/client/utils/getUrl.js
@@ -38,10 +38,11 @@ export default function getUrl(
 	}
 
 	if (hashPath) {
+		let encodedHashPath = hashPath.map(encodeURIComponent);
 		if (!id) {
-			hashPath = [...hashPath, encodedName];
+			encodedHashPath = [...encodedHashPath, encodedName];
 		}
-		url += `#/${hashPath.join('/')}`;
+		url += `#/${encodedHashPath.join('/')}`;
 	}
 
 	if (id) {


Test patch:
diff --git a/src/client/utils/__tests__/getUrl.spec.js b/src/client/utils/__tests__/getUrl.spec.js
index e47f4038..6ae72866 100644
--- a/src/client/utils/__tests__/getUrl.spec.js
+++ b/src/client/utils/__tests__/getUrl.spec.js
@@ -74,6 +74,25 @@ describe('getUrl', () => {
 		expect(result).toBe('/styleguide/#/Documentation/%40foo%2Fcomponents');
 	});
 
+	it('should return a route path with encoded name if sections (hashPath) has inappropriate symbols', () => {
+		expect(
+			getUrl({ name: '@foo/components', slug, hashPath: ['@foo/bar-documentation'] }, loc)
+		).toBe('/styleguide/#/%40foo%2Fbar-documentation/%40foo%2Fcomponents');
+
+		expect(
+			getUrl(
+				{
+					name: '@foo/components',
+					slug,
+					hashPath: ['@foo/bar-documentation', '@foo/bar-activations-section'],
+				},
+				loc
+			)
+		).toBe(
+			'/styleguide/#/%40foo%2Fbar-documentation/%40foo%2Fbar-activations-section/%40foo%2Fcomponents'
+		);
+	});
+
 	it('should return a route path with a param id=foobar', () => {
 		const result = getUrl({ name, slug, hashPath: ['Documentation'], id: true }, loc);
 		expect(result).toBe('/styleguide/#/Documentation?id=foobar');
Repository: styleguidist/react-docgen-typescript
Pull request #485 (2023-08-01 18:19:21)

Handle multiple file extensions in `getDefaultExportForFile`
There are cases that I have run into where the file being analyzed ends with `.d.ts` and that would inadvertently make the displayName end with an unintended `d`.
For example `List.d.ts` would become `Listd`.

This updates the logic in `getDefaultExportForFile` to split based on the first `.` instead of the last.


Patch:
diff --git a/src/parser.ts b/src/parser.ts
index 47a86e5..23e28b9 100644
--- a/src/parser.ts
+++ b/src/parser.ts
@@ -1269,7 +1269,7 @@ function computeComponentName(
 
 // Default export for a file: named after file
 export function getDefaultExportForFile(source: ts.SourceFile) {
-  const name = path.basename(source.fileName, path.extname(source.fileName));
+  const name = path.basename(source.fileName).split('.')[0];
   const filename =
     name === 'index' ? path.basename(path.dirname(source.fileName)) : name;
 


Test patch:
diff --git a/src/__tests__/data/StatelessDisplayNameFolder/Stateless.d.ts b/src/__tests__/data/StatelessDisplayNameFolder/Stateless.d.ts
new file mode 100644
index 0000000..5a1dde4
--- /dev/null
+++ b/src/__tests__/data/StatelessDisplayNameFolder/Stateless.d.ts
@@ -0,0 +1,7 @@
+export interface FooProps {
+  foo?: string;
+}
+
+declare const Foo: React.FC<FooProps>;
+
+export default Foo;
diff --git a/src/__tests__/parser.ts b/src/__tests__/parser.ts
index fab7b73..c185147 100644
--- a/src/__tests__/parser.ts
+++ b/src/__tests__/parser.ts
@@ -45,6 +45,19 @@ describe('parser', () => {
     });
   });
 
+  it('should parse simple typescript definition file with default export', () => {
+    check(
+      'StatelessDisplayNameFolder/Stateless.d.ts',
+      {
+        Stateless: {
+          foo: { description: '', type: 'string', required: false }
+        }
+      },
+      true,
+      ''
+    );
+  });
+
   describe('file path', () => {
     it('should return the correct filepath for a parsed component', () => {
       const results = parse([fixturePath('FilePathCheck')]);
diff --git a/src/__tests__/testUtils.ts b/src/__tests__/testUtils.ts
index c5a3fc6..a8dfc61 100644
--- a/src/__tests__/testUtils.ts
+++ b/src/__tests__/testUtils.ts
@@ -40,7 +40,7 @@ export function fixturePath(componentName: string) {
     'src',
     '__tests__',
     'data',
-    `${componentName}.tsx`
+    `${componentName}${componentName.includes('.ts') ? '' : '.tsx'}`
   ); // it's running in ./temp
 }
Repository: igorkamyshev/farfetched
Pull request #161 (2022-11-04 13:47:37)

Fix nullish value bug in sourced
Fix for a bug in `sourced.ts` `normalizeSourced` function.
When passing a nullish value to the field function do nothing


Patch:
diff --git a/.changeset/early-peaches-deliver.md b/.changeset/early-peaches-deliver.md
new file mode 100644
index 0000000..e090351
--- /dev/null
+++ b/.changeset/early-peaches-deliver.md
@@ -0,0 +1,5 @@
+---
+'@farfetched/core': patch
+---
+
+Fixed a bug in sourced.ts normalizeSourced when passing a nullish value to the field
diff --git a/packages/core/src/misc/sourced.ts b/packages/core/src/misc/sourced.ts
index 47ec919..1c71099 100644
--- a/packages/core/src/misc/sourced.ts
+++ b/packages/core/src/misc/sourced.ts
@@ -37,7 +37,7 @@ function normalizeSourced<Data, Result, Source>({
   let $target = createStore<any>(null, { serialize: 'ignore' });
 
   if (clock) {
-    if (!field) {
+    if (field === undefined) {
       // do nothing
     } else if (is.store(field)) {
       const $storeField = field as Store<Result>;
@@ -65,7 +65,7 @@ function normalizeSourced<Data, Result, Source>({
 
   if (source) {
     const $source = source as Store<Data>;
-    if (!field) {
+    if (field === undefined) {
       // do nothing
     } else if (is.store(field)) {
       const $storeField = field as Store<Result>;


Test patch:
diff --git a/packages/core/src/misc/__tests__/sourced.spec.ts b/packages/core/src/misc/__tests__/sourced.spec.ts
index 0b62ef7..688ab1a 100644
--- a/packages/core/src/misc/__tests__/sourced.spec.ts
+++ b/packages/core/src/misc/__tests__/sourced.spec.ts
@@ -20,6 +20,18 @@ describe('normalizeSourced (with clock)', () => {
     expect(scope.getState($normalized)).toBe('static string');
   });
 
+  test('handle simple nullish value', async () => {
+    const clock = createEvent();
+
+    const $normalized = normalizeSourced({ field: false, clock });
+
+    const scope = fork();
+
+    await allSettled(clock, { scope });
+
+    expect(scope.getState($normalized)).toBe(false);
+  });
+
   test('handle store value', async () => {
     const clock = createEvent();
 
@@ -103,6 +115,23 @@ describe('normalizeSourced (with source)', () => {
     expect(scope.getState($normalized)).toBe('static string');
   });
 
+  test('handle simple nullish value', async () => {
+    const $source = createStore<string>('fdsfd');
+
+    const $normalized = normalizeSourced({
+      field: false,
+      source: $source,
+    });
+
+    const scope = fork();
+
+    expect(scope.getState($normalized)).toBe(false);
+
+    await allSettled($source, { scope, params: 'tretre' });
+
+    expect(scope.getState($normalized)).toBe(false);
+  });
+
   test('handle store value', async () => {
     const $source = createStore('');
Repository: ruby/prism
Pull request #1619 (2023-10-03 17:41:20)

Add full_name to `ConstantPathNode` and `ConstantPathTargetNode`
Add `full_name` to both `ConstantPathNode` and `ConstantPathTargetNode`, so that one can easily figure out the complete name of the constant being referenced.

kddnewton: Ahh yeah these methods should go in node_ext.rb 

Patch:
diff --git a/lib/prism/node_ext.rb b/lib/prism/node_ext.rb
index 08d9e9f3..264d3a5c 100644
--- a/lib/prism/node_ext.rb
+++ b/lib/prism/node_ext.rb
@@ -52,4 +52,48 @@ module Prism
       o
     end
   end
+
+  class ConstantReadNode < Node
+    # Returns the list of parts for the full name of this constant. For example: [:Foo]
+    def full_name_parts
+      [name]
+    end
+
+    # Returns the full name of this constant. For example: "Foo"
+    def full_name
+      name.name
+    end
+  end
+
+  class ConstantPathNode < Node
+    # Returns the list of parts for the full name of this constant path. For example: [:Foo, :Bar]
+    def full_name_parts
+      parts = [child.name]
+      current = parent
+
+      while current.is_a?(ConstantPathNode)
+        parts.unshift(current.child.name)
+        current = current.parent
+      end
+
+      parts.unshift(current&.name || :"")
+    end
+
+    # Returns the full name of this constant path. For example: "Foo::Bar"
+    def full_name
+      full_name_parts.join("::")
+    end
+  end
+
+  class ConstantPathTargetNode < Node
+    # Returns the list of parts for the full name of this constant path. For example: [:Foo, :Bar]
+    def full_name_parts
+      (parent&.full_name_parts || [:""]).push(child.name)
+    end
+
+    # Returns the full name of this constant path. For example: "Foo::Bar"
+    def full_name
+      full_name_parts.join("::")
+    end
+  end
 end


Test patch:
diff --git a/test/prism/constant_path_node_test.rb b/test/prism/constant_path_node_test.rb
new file mode 100644
index 00000000..1a44fbab
--- /dev/null
+++ b/test/prism/constant_path_node_test.rb
@@ -0,0 +1,30 @@
+# frozen_string_literal: true
+
+require_relative "test_helper"
+
+module Prism
+  class ConstantPathNodeTest < TestCase
+    def test_full_name_for_constant_path
+      source = <<~RUBY
+        Foo:: # comment
+          Bar::Baz::
+            Qux
+      RUBY
+
+      constant_path = Prism.parse(source).value.statements.body.first
+      assert_equal("Foo::Bar::Baz::Qux", constant_path.full_name)
+    end
+
+    def test_full_name_for_constant_path_target
+      source = <<~RUBY
+        Foo:: # comment
+          Bar::Baz::
+            Qux, Something = [1, 2]
+      RUBY
+
+      node = Prism.parse(source).value.statements.body.first
+      target = node.targets.first
+      assert_equal("Foo::Bar::Baz::Qux", target.full_name)
+    end
+  end
+end
Repository: ruby/prism
Pull request #2130 (2024-01-03 17:05:30)

Fix rational value when parsing non decimal integer


Patch:
diff --git a/lib/prism/node_ext.rb b/lib/prism/node_ext.rb
index 8c096323..974052e8 100644
--- a/lib/prism/node_ext.rb
+++ b/lib/prism/node_ext.rb
@@ -81,7 +81,7 @@ module Prism
   class RationalNode < Node
     # Returns the value of the node as a Ruby Rational.
     def value
-      Rational(slice.chomp("r"))
+      Rational(numeric.is_a?(IntegerNode) && !numeric.decimal? ? numeric.value : slice.chomp("r"))
     end
   end
 


Test patch:
diff --git a/test/prism/ruby_api_test.rb b/test/prism/ruby_api_test.rb
index 7bb80b48..cf7ea437 100644
--- a/test/prism/ruby_api_test.rb
+++ b/test/prism/ruby_api_test.rb
@@ -57,6 +57,8 @@ module Prism
       assert_equal 0.5r, parse_expression("0.5r").value
       assert_equal 42ri, parse_expression("42ri").value
       assert_equal 0.5ri, parse_expression("0.5ri").value
+      assert_equal 0xFFr, parse_expression("0xFFr").value
+      assert_equal 0xFFri, parse_expression("0xFFri").value
     end
 
     def test_location_join
Repository: ruby/prism
Pull request #2211 (2024-01-18 23:20:50)

Handle stovetop start in constant path full_name
this prevents prism from raising `Constant path contains dynamic parts. Cannot compute full name` when a constant path starts with `::`.


Patch:
diff --git a/lib/prism/node_ext.rb b/lib/prism/node_ext.rb
index 974052e8..1a78759e 100644
--- a/lib/prism/node_ext.rb
+++ b/lib/prism/node_ext.rb
@@ -118,7 +118,7 @@ module Prism
         current = current.parent
       end
 
-      unless current.is_a?(ConstantReadNode)
+      if !current.is_a?(ConstantReadNode) && !current.nil?
         raise DynamicPartsInConstantPathError, "Constant path contains dynamic parts. Cannot compute full name"
       end
 


Test patch:
diff --git a/test/prism/constant_path_node_test.rb b/test/prism/constant_path_node_test.rb
index 9842be0c..aeab6e01 100644
--- a/test/prism/constant_path_node_test.rb
+++ b/test/prism/constant_path_node_test.rb
@@ -52,5 +52,16 @@ module Prism
       node = Prism.parse(source).value.statements.body.first
       assert_equal("Foo::Bar::Baz::Qux", node.lefts.first.full_name)
     end
+
+    def test_full_name_for_constant_path_with_stovetop_start
+      source = <<~RUBY
+        ::Foo:: # comment
+          Bar::Baz::
+            Qux, Something = [1, 2]
+      RUBY
+
+      node = Prism.parse(source).value.statements.body.first
+      assert_equal("::Foo::Bar::Baz::Qux", node.lefts.first.full_name)
+    end
   end
 end