| 2 | // defined. |
| 3 | |
| 4 | Value CreateOrCopyExternalBuffer(const CallbackInfo& info) { |
| 5 | finalizeCount = 0; |
| 6 | |
| 7 | InitData(testData, testLength); |
| 8 | Buffer<uint16_t> buffer = |
| 9 | Buffer<uint16_t>::NewOrCopy(info.Env(), testData, testLength); |
| 10 | |
| 11 | if (buffer.Length() != testLength) { |
| 12 | Error::New(info.Env(), "Incorrect buffer length.") |
| 13 | .ThrowAsJavaScriptException(); |
| 14 | return Value(); |
| 15 | } |
| 16 | |
| 17 | VerifyData(buffer.Data(), testLength); |
| 18 | return buffer; |
| 19 | } |
| 20 | |
| 21 | Value CreateOrCopyExternalBufferWithFinalize(const CallbackInfo& info) { |
| 22 | finalizeCount = 0; |
nothing calls this directly
no test coverage detected