Skip to content

Handle objects with null prototypes as topics#411

Draft
strugee wants to merge 2 commits into
newer-nodesfrom
handle-null-objs
Draft

Handle objects with null prototypes as topics#411
strugee wants to merge 2 commits into
newer-nodesfrom
handle-null-objs

Conversation

@strugee

@strugee strugee commented Feb 19, 2026

Copy link
Copy Markdown
Member

See the inline comment - impetus here is that if you require() an ES6 module, you get an Object with its prototype set to null, which results in this crash:

[snipped]
  vows:batch Beginning topic of batch 'When we get the conference space planner module' +0ms
  vows:batch Completed topic of batch 'When we get the conference space planner module' +17ms
  vows:batch Results of topic of batch 'When we get the conference space planner module' defined and not a Promise; running sync +0ms
  vows:at-most-once First call of atMostOnce() wrapper of bound () +17ms
/var/home/alex/Development/patch/node_modules/vows/lib/batch.js:164
      debug(`Results for topic of '${this.title}': ${err}, ${results.join(', ')}`)
                                                                     ^

TypeError: Cannot convert object to primitive value
    at Array.join (<anonymous>:null:null)
    at Batch.<anonymous> (/var/home/alex/Development/patch/node_modules/vows/lib/batch.js:164:70)
[snipped]

Because there's no toString on the module object, type coercion fails.

@strugee strugee force-pushed the handle-null-objs branch 2 times, most recently from 8ebece4 to 19bc1f7 Compare February 19, 2026 06:41
@strugee

strugee commented Feb 19, 2026

Copy link
Copy Markdown
Member Author

Tests passing locally for me under Node 24

@strugee

strugee commented Feb 21, 2026

Copy link
Copy Markdown
Member Author

Rebasing on #413 to get CI coverage of our supported versions.

@strugee strugee changed the base branch from master to newer-nodes February 21, 2026 01:24
@strugee strugee force-pushed the newer-nodes branch 2 times, most recently from bd11ed2 to 5dbdadd Compare February 21, 2026 02:08
@strugee

strugee commented Feb 21, 2026

Copy link
Copy Markdown
Member Author

Marking as draft since I'm experiencing related crashes in SeaGL/patch and am unsure if this is a full fix.

@strugee strugee marked this pull request as draft February 21, 2026 03:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant