Skip to content

Conversation

@styfle
Copy link
Member

@styfle styfle commented Nov 9, 2025

@styfle styfle requested review from a team as code owners November 9, 2025 20:53
import value from './bytes-from-empty-FIXTURE.bin' with { type: 'bytes' };

assert(value instanceof Uint8Array);
assert(value.buffer instanceof ArrayBuffer);
Copy link
Member

Choose a reason for hiding this comment

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

there should be some kind of assertion that it's immutable (not sure what that'd look like tho)

same throughout

Copy link
Member Author

@styfle styfle Dec 22, 2025

Choose a reason for hiding this comment

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

The lines below are checking for immutable (asserts that an error is thrown on resize and also on transfer)

assert.throws(TypeError, function() {
  value.buffer.resize(0);
});

assert.throws(TypeError, function() {
  value.buffer.transfer();
});

Let me know if there is a better way to check for immutability.

Copy link
Contributor

Choose a reason for hiding this comment

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

@ptomato
Copy link
Contributor

ptomato commented Nov 10, 2025

Note, the empty file is failing because fixture files need to contain the string _FIXTURE and these have a dash where they should have an underscore: https://github.com/tc39/test262/blob/main/INTERPRETING.md#modules

@styfle styfle mentioned this pull request Dec 22, 2025
8 tasks
@styfle
Copy link
Member Author

styfle commented Dec 22, 2025

@ptomato Thanks! I updated the fixtures to use underscores and that solved the Test262File: missing "contents" error.

However, I ran into another error.

  File "/home/runner/work/test262/test262/tools/generation/lib/test.py", line 29, in load
    self.source = handle.read()
                  ~~~~~~~~~~~^^
  File "<frozen codecs>", line 325, in decode
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x89 in position 0: invalid start byte

So I pushed some changes to the python code to ignore binary files.

I see there are still a few engines on circleci that are failing. Please let me know how to proceed, thanks!

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.

Test plan for import bytes

4 participants