Skip to content

Commit

Permalink
wrapping apply and construct hooks instead of providing Reflect.* dir…
Browse files Browse the repository at this point in the history
…ectly to avoid issue 1042435 in blick/chromium
  • Loading branch information
caridy committed Jan 20, 2020
1 parent fb04f14 commit 04ac821
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,12 @@ export class SecureEnvironment implements MembraneBroker {
// the proper errors without leaking instances into a sandbox
const secureEnvFactory = secureGlobalThis.eval(`(${serializedSecureEnvSourceText})`);
const rawHooks: MarshalHooks = {
apply,
construct,
apply(target: RawFunction, thisArgument: RawValue, argumentsList: ArrayLike<RawValue>): RawValue {
return apply(target, thisArgument, argumentsList);
},
construct(target: RawConstructor, argumentsList: ArrayLike<RawValue>, newTarget?: any): RawValue {
return construct(target, argumentsList, newTarget);
},
};
this.getSecureValue = secureEnvFactory(this, rawHooks);
this.getRawValue = reverseProxyFactory(this);
Expand Down

0 comments on commit 04ac821

Please sign in to comment.