Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass constructor arguments to TextDecoder #3692

Merged
merged 5 commits into from Jul 20, 2023

Conversation

Parzival-3141
Copy link
Contributor

The constructor now actually sets TextDecoder properties using the options parameter. This lets users enable the fatal parameter, closing #3572.

The constructor now actually sets TextDecoder properties using the
options parameter.
Copy link
Collaborator

@Jarred-Sumner Jarred-Sumner left a comment

Choose a reason for hiding this comment

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

Thank you. This is close, but not ready to merge yet

@Parzival-3141
Copy link
Contributor Author

Two things that I noticed while testing:

  1. TextDecoder.decode throws a generic Error instead of TypeError as specified in the WHATWG standard. Is this intentional or an oversight?
  2. The getter for TextDecoder.ignoreBOM seems to be broken and will always return undefined. I'm not sure why this happens

@paperdave
Copy link
Collaborator

point 1 is definitely an oversight, or maybe there wasnt a binding for throwTypeError at the time.

the hint for point 2 is in encoding.classes.ts

@Parzival-3141
Copy link
Contributor Author

@paperdave hm, I can't seem to get my changes in encoding.classes.ts to work. Running make codegen fails as well:

~/bun$ make codegen
bun src/bun.js/scripts/generate-jssink.js
/usr/bin/clang-format-15 -i  src/bun.js/bindings/JSSink.cpp  src/bun.js/bindings/JSSink.h
/home/ubuntu/bun/src/bun.js/WebKit/Source/JavaScriptCore/create_hash_table src/bun.js/bindings/JSSink.cpp > src/bun.js/bindings/JSSinkLookupTable.h
/usr/bin/bash: line 1: /home/ubuntu/bun/src/bun.js/WebKit/Source/JavaScriptCore/create_hash_table: No such file or directory
make: *** [Makefile:1474: generate-sink] Error 127

@paperdave
Copy link
Collaborator

We should copy that script into our repo, but you can use make generate-classes instead

@Parzival-3141
Copy link
Contributor Author

@paperdave no dice unfortunately. make generate-classes runs fine but ignoreBOM is still undefined. Is there something else I'm missing?

@Jarred-Sumner Jarred-Sumner merged commit c383c6c into oven-sh:main Jul 20, 2023
@Jarred-Sumner
Copy link
Collaborator

Thank you

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.

None yet

3 participants