Skip to content
This repository has been archived by the owner on Nov 27, 2023. It is now read-only.

Commit

Permalink
Merge pull request #150 from KnisterPeter/strict-mode-workaround
Browse files Browse the repository at this point in the history
fix: access to restricted properties
  • Loading branch information
KnisterPeter authored Sep 6, 2017
2 parents e69e2e8 + 9c9f75d commit 97013c2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[*]
indent_style = space
indent_size = 2
insert_final_newline = true
8 changes: 7 additions & 1 deletion lib/external.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,13 @@ export function External<TFunction extends Function>(...args: any[]): ClassDecor
};
(constructor as any).displayName = (target as any).name;
Object.getOwnPropertyNames(target)
.filter(prop => !(constructor as any)[prop] && prop !== 'name' && prop !== 'length')
.filter(prop =>
prop !== 'name' &&
prop !== 'length' &&
prop !== 'caller' &&
prop !== 'callee' &&
prop !== 'arguments' &&
!(constructor as any)[prop])
.forEach(prop => (constructor as any)[prop] = (target as any)[prop]);
constructor.prototype = target.prototype;
return constructor as any;
Expand Down

0 comments on commit 97013c2

Please sign in to comment.