Skip to content

Drop duplicate isPrimitive() in harness/testTypedArray.js#5036

Open
ivankra wants to merge 1 commit intotc39:mainfrom
ivankra:isPrimitive
Open

Drop duplicate isPrimitive() in harness/testTypedArray.js#5036
ivankra wants to merge 1 commit intotc39:mainfrom
ivankra:isPrimitive

Conversation

@ivankra
Copy link
Copy Markdown
Contributor

@ivankra ivankra commented Apr 20, 2026

It's already defined in harness/assert.js, included in every test.

Some engines/runtimes e.g. deno complain about redeclarations in the same scope and abort execution.

@ivankra ivankra requested a review from a team as a code owner April 20, 2026 04:35
Copy link
Copy Markdown
Member

@ljharb ljharb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this doesn't seem like a duplicate - where's the second function definition?

@linusg
Copy link
Copy Markdown
Member

linusg commented Apr 20, 2026

function isPrimitive(value) {

@ljharb
Copy link
Copy Markdown
Member

ljharb commented Apr 20, 2026

ah ok, it's a global. makes sense

@ptomato
Copy link
Copy Markdown
Contributor

ptomato commented Apr 21, 2026

Can we add isPrimitive to the defines in assert.js and expect that tests might use it? (Or, if not, move it inside the compareArray function body)

@ivankra
Copy link
Copy Markdown
Contributor Author

ivankra commented Apr 21, 2026

Added it to defines in assert.js.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

4 participants