Skip to content

Commit be053bb

Browse files
author
Guillaume Chau
committed
test: add proxied function example
1 parent 7244c79 commit be053bb

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

shells/dev/target/NativeTypes.vue

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,19 @@ function setToString (func, string) {
4444
4545
const aWeirdFunction = setToString(function weird (a, b, c) {}, 'foo')
4646
47+
function sum (a, b) {
48+
return a + b
49+
}
50+
51+
const handler = {
52+
apply: function (target, thisArg, argumentsList) {
53+
console.log(`Calculate sum: ${argumentsList}`)
54+
return argumentsList[0] + argumentsList[1]
55+
}
56+
}
57+
58+
const proxy1 = new Proxy(sum, handler)
59+
4760
export default {
4861
components: {
4962
TestComponent: {
@@ -79,7 +92,8 @@ export default {
7992
j: new Map([[1, 2], [3, 4], [5, new Map([[6, 7]])], [8, new Set([1, 2, 3, 4, new Set([5, 6, 7, 8]), new Map([[1, 2], [3, 4], [5, new Map([[6, 7]])]])])]]),
8093
html: '<b>Bold</b> <i>Italic</i>',
8194
htmlReg: /<b>hey<\/b>/i,
82-
'html <b>key</b>': (h, t, m, l) => {}
95+
'html <b>key</b>': (h, t, m, l) => {},
96+
proxy1
8397
}
8498
},
8599
computed: {

0 commit comments

Comments
 (0)