From a2e3b9bdf6913121106ef562b4f8cf058d113b95 Mon Sep 17 00:00:00 2001 From: dvabuzyarov Date: Mon, 21 Dec 2020 11:49:47 +0200 Subject: [PATCH] docs: the new operator support has been documented #130 --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4480ee6d5..7d9eacbcd 100644 --- a/README.md +++ b/README.md @@ -532,6 +532,10 @@ mock.verify(instance => "method" in instance, Times.Once()); The library supports [new operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/new). More examples could be found [here](https://raw.githubusercontent.com/dvabuzyarov/moq.ts/master/projects/moq/src/integration.specs/new-operator.spec.ts) +> [In order for the new operation to be valid on the resulting Proxy object, +> the target used to initialize the proxy must itself have a [[Construct]] internal method +> (i.e. new target must be valid)](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy/Proxy/construct). + ```typescript class TestObject { constructor(public readonly arg) { @@ -608,4 +612,4 @@ expect(MoqAPI in object).toBe(true); expect(object[MoqAPI]).toBe(mock); ``` -Sponsored by [2BIT](https://www.2bit.ch) +> [Sponsored by 2BIT GmbH](https://www.2bit.ch)