deno-dom icon indicating copy to clipboard operation
deno-dom copied to clipboard

TreeWalker

Open 0xAozora opened this issue 3 years ago • 7 comments

TreeWalker implementation for native, The wpt/dom/traversal/TreeWalker unittest seems to be broken, it passes all other test.

I hope this helps.

0xAozora avatar Apr 10 '21 18:04 0xAozora

Thanks for the PR. A few things:

The codebase style needs to be honored, so

  • only strict equality (===) except for == null to match null or undefined
  • always end lines with semi-colons
  • only double-quotes for strings
  • always 2 space indents
  • trailing commas
  • Typescript enum instead of abstract classes
  • spaces after control flow block keywords i.e. if (...) and while (...) instead of if(...), etc

I really need to setup deno fmt or smth already :sweat:

There are also parts that touch unrelated parts of the codebase; please submit a separate PR for those

b-fuze avatar Apr 10 '21 19:04 b-fuze

I did you the honor.

There are also parts that touch unrelated parts of the codebase; please submit a separate PR for those

Any idea how to outsource part of the commits to a separate branch?

Also, how did you run the wpt tests? I had to comment out the argument check since deno doesnt allow arguments when testing.

0xAozora avatar Apr 10 '21 20:04 0xAozora

Alright, thanks. Everything mostly looks fine, but I'll check it in more detail later today or tomorrow.

Any idea how to outsource part of the commits to a separate branch?

You can create a new branch with

git checkout -b new-branch-name

run git reflog to see the commit that you had to revert or whatever, then run

git reset --hard $COMMIT_HASH_FROM_REFLOG

then the new branch will have the contents of the commit you reverted.

Also, how did you run the wpt tests? I had to comment out the argument check since deno doesnt allow arguments when testing.

It's in the "Running tests" section of the readme:

Then append -- --wpt to the test command before running it, e.g. for WASM

deno test --allow-read wasm.test.ts -- --wpt

b-fuze avatar Apr 10 '21 21:04 b-fuze

Btw, to revert a full file you can use

git checkout 813ce27 ./path/to/file.ts

b-fuze avatar Apr 14 '21 11:04 b-fuze