From: Parsha Pourkhomami Date: Tue, 7 Jul 2015 19:02:07 +0000 (-0700) Subject: Test buf.constructor is set to Buffer X-Git-Url: https://zoso.dev/?a=commitdiff_plain;h=364ab7048f512e582868d40a17020ce2405586c3;p=buffer.git Test buf.constructor is set to Buffer Currently fails in Safari 5.1. See https://saucelabs.com/beta/tests/c99d86b2a82944539bbb1fe25a8506d3 --- diff --git a/test/basic.js b/test/basic.js index cdaa37d..af6d5ee 100644 --- a/test/basic.js +++ b/test/basic.js @@ -2,6 +2,12 @@ var B = require('../').Buffer var test = require('tape') if (process.env.OBJECT_IMPL) B.TYPED_ARRAY_SUPPORT = false +test('buf.constructor is Buffer', function (t) { + var buf = new B([1, 2]) + t.strictEqual(buf.constructor, B) + t.end() +}) + test('convert to Uint8Array in modern browsers', function (t) { if (B.TYPED_ARRAY_SUPPORT) { var buf = new B([1, 2])