-
Notifications
You must be signed in to change notification settings - Fork 405
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(signals): avoid throwing when
in
check throws (#5105)
Co-authored-by: Will Harney <62956339+wjhsf@users.noreply.github.com>
- Loading branch information
1 parent
08ec091
commit 3cff847
Showing
5 changed files
with
53 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
packages/@lwc/integration-karma/test/signal/protocol/x/throws/throws.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<template> | ||
<h1>hello</h1> | ||
</template> |
23 changes: 23 additions & 0 deletions
23
packages/@lwc/integration-karma/test/signal/protocol/x/throws/throws.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { LightningElement } from 'lwc'; | ||
|
||
export default class extends LightningElement { | ||
foo; | ||
|
||
constructor() { | ||
super(); | ||
|
||
this.foo = new Proxy( | ||
{}, | ||
{ | ||
has() { | ||
throw new Error("oh no you don't!"); | ||
}, | ||
} | ||
); | ||
} | ||
|
||
renderedCallback() { | ||
// access `this.foo` to trigger mutation-tracker.ts | ||
this.bar = this.foo; | ||
} | ||
} |