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

fix(engine): handling event target in window listeners #499

Merged
merged 2 commits into from Jul 12, 2018

Conversation

davidturissini
Copy link
Contributor

Details

Fixes event.target usage in event listeners on window

Does this PR introduce a breaking change?

  • Yes
  • No

@@ -49,7 +49,7 @@ const EventPatchDescriptors: PropertyDescriptorMap = {
get(this: Event): EventTarget {
const currentTarget: EventTarget = eventCurrentTargetGetter.call(this);
const originalTarget: EventTarget = eventTargetGetter.call(this);
if (isNull(currentTarget)) {
if (isNull(currentTarget) || !(currentTarget instanceof Node)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

it seems that this could just be simplified to !(currentTarget instanceof Node) since null instanceof Node is also false.

Copy link
Contributor

Choose a reason for hiding this comment

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

maybe also adding a note here so we can remember the why :)

Copy link
Contributor

@diervo diervo left a comment

Choose a reason for hiding this comment

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

Fix caridy suggestion and ship it

@caridy
Copy link
Contributor

caridy commented Jul 12, 2018

this one is 0.24.x

@salesforce-best-lwc-internal
Copy link

Benchmark results

Base commit: 3f8c066 | Target commit: 2a2f08c

lwc-engine-benchmark

table-append-1k metric base(3f8c066) target(2a2f08c) trend
benchmark-table/append/1k duration 155.20 (± 6.50 ms) 156.40 (± 5.70 ms) -0.77% 👌
table-clear-1k metric base(3f8c066) target(2a2f08c) trend
benchmark-table/clear/1k duration 12.40 (± 0.40 ms) 12.70 (± 0.70 ms) -2.42% 👎
table-create-10k metric base(3f8c066) target(2a2f08c) trend
benchmark-table/create/10k duration 920.60 (± 12.90 ms) 929.80 (± 4.80 ms) -1.00% 👌
table-create-1k metric base(3f8c066) target(2a2f08c) trend
benchmark-table/create/1k duration 107.20 (± 2.40 ms) 103.90 (± 2.00 ms) 3.08% 👍
table-update-10th-1k metric base(3f8c066) target(2a2f08c) trend
benchmark-table/update-10th/1k duration 92.10 (± 4.40 ms) 87.20 (± 5.10 ms) 5.32% 👍
tablecmp-append-1k metric base(3f8c066) target(2a2f08c) trend
benchmark-table-component/append/1k duration 239.10 (± 3.90 ms) 236.10 (± 4.30 ms) 1.25% 👌
tablecmp-clear-1k metric base(3f8c066) target(2a2f08c) trend
benchmark-table-component/clear/1k duration 37.00 (± 1.80 ms) 35.90 (± 2.40 ms) 2.97% 👌
tablecmp-create-10k metric base(3f8c066) target(2a2f08c) trend
benchmark-table-component/create/10k duration 1611.10 (± 11.30 ms) 1639.30 (± 8.70 ms) -1.75% 👎
tablecmp-create-1k metric base(3f8c066) target(2a2f08c) trend
benchmark-table-component/create/1k duration 174.50 (± 2.70 ms) 176.20 (± 4.10 ms) -0.97% 👌
tablecmp-update-10th-1k metric base(3f8c066) target(2a2f08c) trend
benchmark-table-component/update-10th/1k duration 79.95 (± 4.50 ms) 78.30 (± 4.80 ms) 2.06% 👌
wc-append-1k metric base(3f8c066) target(2a2f08c) trend
benchmark-table-wc/append/1k duration 271.10 (± 12.20 ms) 275.20 (± 10.40 ms) -1.51% 👎
wc-clear-1k metric base(3f8c066) target(2a2f08c) trend
benchmark-table-wc/clear/1k duration 38.60 (± 1.10 ms) 37.35 (± 1.25 ms) 3.24% 👍
wc-create-10k metric base(3f8c066) target(2a2f08c) trend
benchmark-table-wc/create/10k duration 2121.80 (± 9.60 ms) 2129.80 (± 10.10 ms) -0.38% 👎
wc-create-1k metric base(3f8c066) target(2a2f08c) trend
benchmark-table-wc/create/1k duration 217.80 (± 5.20 ms) 216.10 (± 4.20 ms) 0.78% 👌
wc-update-10th-1k metric base(3f8c066) target(2a2f08c) trend
benchmark-table-wc/update-10th/1k duration 79.20 (± 3.90 ms) 77.65 (± 6.15 ms) 1.96% 👌

@salesforce-best-lwc-internal
Copy link

Benchmark results

Base commit: 3f8c066 | Target commit: e31a250

lwc-engine-benchmark

table-append-1k metric base(3f8c066) target(e31a250) trend
benchmark-table/append/1k duration 155.20 (± 6.50 ms) 157.20 (± 7.20 ms) -1.29% 👌
table-clear-1k metric base(3f8c066) target(e31a250) trend
benchmark-table/clear/1k duration 12.40 (± 0.40 ms) 12.80 (± 0.85 ms) -3.23% 👎
table-create-10k metric base(3f8c066) target(e31a250) trend
benchmark-table/create/10k duration 920.60 (± 12.90 ms) 911.00 (± 8.70 ms) 1.04% 👍
table-create-1k metric base(3f8c066) target(e31a250) trend
benchmark-table/create/1k duration 107.20 (± 2.40 ms) 103.00 (± 2.20 ms) 3.92% 👍
table-update-10th-1k metric base(3f8c066) target(e31a250) trend
benchmark-table/update-10th/1k duration 92.10 (± 4.40 ms) 87.65 (± 5.40 ms) 4.83% 👍
tablecmp-append-1k metric base(3f8c066) target(e31a250) trend
benchmark-table-component/append/1k duration 239.10 (± 3.90 ms) 235.60 (± 5.30 ms) 1.46% 👍
tablecmp-clear-1k metric base(3f8c066) target(e31a250) trend
benchmark-table-component/clear/1k duration 37.00 (± 1.80 ms) 37.00 (± 1.30 ms) 0.00% 👌
tablecmp-create-10k metric base(3f8c066) target(e31a250) trend
benchmark-table-component/create/10k duration 1611.10 (± 11.30 ms) 1680.10 (± 10.30 ms) -4.28% 👎
tablecmp-create-1k metric base(3f8c066) target(e31a250) trend
benchmark-table-component/create/1k duration 174.50 (± 2.70 ms) 177.80 (± 4.30 ms) -1.89% 👎
tablecmp-update-10th-1k metric base(3f8c066) target(e31a250) trend
benchmark-table-component/update-10th/1k duration 79.95 (± 4.50 ms) 77.00 (± 4.50 ms) 3.69% 👌
wc-append-1k metric base(3f8c066) target(e31a250) trend
benchmark-table-wc/append/1k duration 271.10 (± 12.20 ms) 277.90 (± 6.80 ms) -2.51% 👌
wc-clear-1k metric base(3f8c066) target(e31a250) trend
benchmark-table-wc/clear/1k duration 38.60 (± 1.10 ms) 38.40 (± 1.60 ms) 0.52% 👌
wc-create-10k metric base(3f8c066) target(e31a250) trend
benchmark-table-wc/create/10k duration 2121.80 (± 9.60 ms) 2142.60 (± 8.60 ms) -0.98% 👎
wc-create-1k metric base(3f8c066) target(e31a250) trend
benchmark-table-wc/create/1k duration 217.80 (± 5.20 ms) 222.70 (± 4.40 ms) -2.25% 👎
wc-update-10th-1k metric base(3f8c066) target(e31a250) trend
benchmark-table-wc/update-10th/1k duration 79.20 (± 3.90 ms) 76.90 (± 5.00 ms) 2.90% 👍

@davidturissini davidturissini merged commit 0ff8ff2 into master Jul 12, 2018
@davidturissini davidturissini deleted the dturissini/window-event-listener branch July 12, 2018 00:16
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

5 participants