Skip to content

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

Merged
ptomato merged 1 commit into
tc39:mainfrom
ivankra:isPrimitive
May 6, 2026
Merged

Drop duplicate isPrimitive() in harness/testTypedArray.js#5036
ptomato merged 1 commit into
tc39: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.

Copy link
Copy Markdown
Contributor

@ptomato ptomato left a comment

Choose a reason for hiding this comment

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

Yes, confirmed that we do want to expose isPrimitive for tests.

@ptomato ptomato merged commit d961145 into tc39:main May 6, 2026
14 checks passed
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.

5 participants