Skip to content

Commit

Permalink
wip: add missing header
Browse files Browse the repository at this point in the history
  • Loading branch information
jodarove committed Jun 21, 2021
1 parent 8e9aad0 commit 951b8ae
Showing 1 changed file with 21 additions and 12 deletions.
33 changes: 21 additions & 12 deletions packages/@lwc/template-compiler/src/codegen/NodeRefProxy.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,32 @@
/*
* Copyright (c) 2018, salesforce.com, inc.
* All rights reserved.
* SPDX-License-Identifier: MIT
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
*/
export class NodeRefProxy {
instance: any;
target: any;

constructor(target: any) {
this.target = target
this.instance = new Proxy({}, {
has: (dummy: any, property: PropertyKey) => {
return property in this.target;
},
this.target = target;
this.instance = new Proxy(
{},
{
has: (dummy: any, property: PropertyKey) => {
return property in this.target;
},

get: (dummy: any, property: PropertyKey) => {
return this.target[property];
},
get: (dummy: any, property: PropertyKey) => {
return this.target[property];
},

set: (dummy: any, property: PropertyKey, value: any) => {
this.target[property] = value;
return true;
set: (dummy: any, property: PropertyKey, value: any) => {
this.target[property] = value;
return true;
},
}
});
);
}

swap(newTarget: any) {
Expand Down

0 comments on commit 951b8ae

Please sign in to comment.