-* } catch ( err ) {
-* console.log( 'Environment does not support SharedArrayBuffers.' );
-* }
-*/
-
-// MODULES //
-
-var hasSharedArrayBufferSupport = require( '@stdlib/assert-has-sharedarraybuffer-support' ); // eslint-disable-line id-length
-var builtin = require( './main.js' );
-var polyfill = require( './polyfill.js' );
-
-
-// MAIN //
-
-var ctor;
-if ( hasSharedArrayBufferSupport() ) {
- ctor = builtin;
-} else {
- ctor = polyfill;
-}
-
-
-// EXPORTS //
-
-module.exports = ctor;
diff --git a/lib/main.js b/lib/main.js
deleted file mode 100644
index fa86dd9..0000000
--- a/lib/main.js
+++ /dev/null
@@ -1,28 +0,0 @@
-/**
-* @license Apache-2.0
-*
-* Copyright (c) 2018 The Stdlib Authors.
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-'use strict';
-
-// MAIN //
-
-var ctor = ( typeof SharedArrayBuffer === 'function' ) ? SharedArrayBuffer : null; // eslint-disable-line stdlib/require-globals, no-undef
-
-
-// EXPORTS //
-
-module.exports = ctor;
diff --git a/lib/polyfill.js b/lib/polyfill.js
deleted file mode 100644
index 0fb9518..0000000
--- a/lib/polyfill.js
+++ /dev/null
@@ -1,36 +0,0 @@
-/**
-* @license Apache-2.0
-*
-* Copyright (c) 2018 The Stdlib Authors.
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-'use strict';
-
-// MAIN //
-
-/**
-* Constructor returning an object used to represent a generic, fixed-length raw binary data buffer which can be used to create views of shared memory.
-*
-* @param {NonNegativeInteger} size - number of bytes
-* @throws {Error} not implemented
-*/
-function polyfill( size ) { // eslint-disable-line no-unused-vars
- throw new Error( 'not supported. The current environment does not support SharedArrayBuffers, and, unfortunately, SharedArrayBuffers cannot be polyfilled. For shared memory applications, upgrade your runtime environment to one which supports SharedArrayBuffers.' );
-}
-
-
-// EXPORTS //
-
-module.exports = polyfill;
diff --git a/package.json b/package.json
index 4f03b37..1df73b3 100644
--- a/package.json
+++ b/package.json
@@ -3,31 +3,7 @@
"version": "0.2.2",
"description": "SharedArrayBuffer.",
"license": "Apache-2.0",
- "author": {
- "name": "The Stdlib Authors",
- "url": "https://github.com/stdlib-js/stdlib/graphs/contributors"
- },
- "contributors": [
- {
- "name": "The Stdlib Authors",
- "url": "https://github.com/stdlib-js/stdlib/graphs/contributors"
- }
- ],
- "main": "./lib",
- "directories": {
- "benchmark": "./benchmark",
- "doc": "./docs",
- "example": "./examples",
- "lib": "./lib",
- "test": "./test"
- },
- "types": "./docs/types",
- "scripts": {
- "test": "make test",
- "test-cov": "make test-cov",
- "examples": "make examples",
- "benchmark": "make benchmark"
- },
+ "main": "./index.js",
"homepage": "https://stdlib.io",
"repository": {
"type": "git",
@@ -36,42 +12,6 @@
"bugs": {
"url": "https://github.com/stdlib-js/stdlib/issues"
},
- "dependencies": {
- "@stdlib/assert-has-sharedarraybuffer-support": "^0.2.2"
- },
- "devDependencies": {
- "@stdlib/array-float64": "^0.2.2",
- "@stdlib/array-uint8": "^0.2.2",
- "@stdlib/assert-has-own-property": "^0.2.2",
- "@stdlib/assert-has-property": "^0.2.2",
- "@stdlib/assert-instance-of": "^0.2.2",
- "@stdlib/assert-is-function": "^0.2.2",
- "@stdlib/assert-is-sharedarraybuffer": "^0.2.2",
- "@stdlib/constants-float64-max-safe-integer": "^0.2.2",
- "@stdlib/math-base-special-pow": "^0.3.0",
- "@stdlib/number-uint8-base-to-binary-string": "^0.2.2",
- "@stdlib/random-base-randu": "^0.2.1",
- "proxyquire": "^2.0.0",
- "tape": "git+https://github.com/kgryte/tape.git#fix/globby",
- "istanbul": "^0.4.1",
- "tap-min": "git+https://github.com/Planeshifter/tap-min.git",
- "@stdlib/bench-harness": "^0.2.2"
- },
- "engines": {
- "node": ">=0.10.0",
- "npm": ">2.7.0"
- },
- "os": [
- "aix",
- "darwin",
- "freebsd",
- "linux",
- "macos",
- "openbsd",
- "sunos",
- "win32",
- "windows"
- ],
"keywords": [
"stdlib",
"stdtypes",
diff --git a/stats_browser.html b/stats_browser.html
new file mode 100644
index 0000000..dbeb00d
--- /dev/null
+++ b/stats_browser.html
@@ -0,0 +1,4842 @@
+
+
+
+
+
+
+
+ Rollup Visualizer
+
+
+
+
+
+
+
+
+
diff --git a/stats_node.html b/stats_node.html
new file mode 100644
index 0000000..6e446b4
--- /dev/null
+++ b/stats_node.html
@@ -0,0 +1,4842 @@
+
+
+
+
+
+
+
+ Rollup Visualizer
+
+
+
+
+
+
+
+
+
diff --git a/test/dist/test.js b/test/dist/test.js
deleted file mode 100644
index a8a9c60..0000000
--- a/test/dist/test.js
+++ /dev/null
@@ -1,33 +0,0 @@
-/**
-* @license Apache-2.0
-*
-* Copyright (c) 2023 The Stdlib Authors.
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-'use strict';
-
-// MODULES //
-
-var tape = require( 'tape' );
-var main = require( './../../dist' );
-
-
-// TESTS //
-
-tape( 'main export is defined', function test( t ) {
- t.ok( true, __filename );
- t.strictEqual( main !== void 0, true, 'main export is defined' );
- t.end();
-});
diff --git a/test/test.js b/test/test.js
deleted file mode 100644
index 71a03b0..0000000
--- a/test/test.js
+++ /dev/null
@@ -1,182 +0,0 @@
-/**
-* @license Apache-2.0
-*
-* Copyright (c) 2018 The Stdlib Authors.
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-'use strict';
-
-// MODULES //
-
-var tape = require( 'tape' );
-var proxyquire = require( 'proxyquire' );
-var hasSharedArrayBufferSupport = require( '@stdlib/assert-has-sharedarraybuffer-support' ); // eslint-disable-line id-length
-var isFunction = require( '@stdlib/assert-is-function' );
-var instanceOf = require( '@stdlib/assert-instance-of' );
-var MAX_SAFE_INTEGER = require( '@stdlib/constants-float64-max-safe-integer' );
-var hasOwnProp = require( '@stdlib/assert-has-own-property' );
-var hasProp = require( '@stdlib/assert-has-property' );
-var polyfill = require( './../lib/polyfill.js' );
-var Ctor = require( './../lib' );
-
-
-// VARIABLES //
-
-var opts = {
- 'skip': !hasSharedArrayBufferSupport()
-};
-
-
-// TESTS //
-
-tape( 'main export is a function', function test( t ) {
- t.ok( true, __filename );
- t.strictEqual( typeof Ctor, 'function', 'main export is a function' );
- t.end();
-});
-
-tape( 'if an environment supports `SharedArrayBuffer`, the export is an alias for `SharedArrayBuffer`', function test( t ) {
- var Foo = proxyquire( './../lib', {
- '@stdlib/assert-has-sharedarraybuffer-support': isTrue,
- './main.js': Mock
- });
- t.strictEqual( Foo, Mock, 'returns built-in' );
-
- if ( !opts.skip ) {
- t.strictEqual( Ctor, SharedArrayBuffer, 'is alias' ); // eslint-disable-line stdlib/require-globals, no-undef
- }
-
- t.end();
-
- function Mock() {
- return this;
- }
-
- function isTrue() {
- return true;
- }
-});
-
-tape( 'if an environment does not support `SharedArrayBuffer`, the export is a polyfill', function test( t ) {
- var Foo = proxyquire( './../lib', {
- '@stdlib/assert-has-sharedarraybuffer-support': isFalse
- });
-
- t.strictEqual( Foo, polyfill, 'returns polyfill' );
- t.end();
-
- function isFalse() {
- return false;
- }
-});
-
-tape( 'the main export is a constructor', opts, function test( t ) {
- var buf = new Ctor( 10 );
- t.strictEqual( instanceOf( buf, Ctor ), true, 'returns an instance' );
- t.end();
-});
-
-tape( 'the constructor length is equal to `1`', opts, function test( t ) {
- t.strictEqual( Ctor.length, 1, 'returns expected value' );
- t.end();
-});
-
-tape( 'the constructor throws an error if provided a value exceeding `2^53-1`', opts, function test( t ) {
- t.throws( badValue, RangeError, 'throws an error' );
- t.end();
-
- function badValue() {
- return new Ctor( MAX_SAFE_INTEGER+1 );
- }
-});
-
-tape( 'the constructor returns a `SharedArrayBuffer` instance having a `byteLength` property, which returns the number of bytes in a `SharedArrayBuffer`', opts, function test( t ) {
- var buf;
-
- t.strictEqual( hasOwnProp( Ctor.prototype, 'byteLength' ), true, 'has prototype property' );
-
- buf = new Ctor( 10 );
- t.strictEqual( hasOwnProp( buf, 'byteLength' ), false, 'does not have own property' );
- t.strictEqual( hasProp( buf, 'byteLength' ), true, 'has property' );
- t.strictEqual( buf.byteLength, 10, 'returns expected value' );
-
- t.end();
-});
-
-tape( 'the constructor returns a `SharedArrayBuffer` instance having a `slice` method, which copies the bytes of a `SharedArrayBuffer` to a new `SharedArrayBuffer`', opts, function test( t ) {
- var b1;
- var b2;
-
- t.strictEqual( hasOwnProp( Ctor.prototype, 'slice' ), true, 'has prototype property' );
- t.strictEqual( isFunction( Ctor.prototype.slice ), true, 'has method' );
-
- b1 = new Ctor( 10 );
- t.strictEqual( hasOwnProp( b1, 'slice' ), false, 'does not have own property' );
- t.strictEqual( hasProp( b1, 'slice' ), true, 'has property' );
-
- b2 = b1.slice();
- t.strictEqual( instanceOf( b2, Ctor ), true, 'returns an instance' );
- t.notEqual( b2, b1, 'returns a new reference' );
- t.strictEqual( b2.byteLength, b1.byteLength, 'has same number of bytes' );
-
- b2 = b1.slice( 2 );
- t.strictEqual( instanceOf( b2, Ctor ), true, 'returns an instance' );
- t.notEqual( b2, b1, 'returns a new reference' );
- t.strictEqual( b2.byteLength, 8, 'has expected number of bytes' );
-
- b2 = b1.slice( b1.byteLength + 10 );
- t.strictEqual( instanceOf( b2, Ctor ), true, 'returns an instance' );
- t.notEqual( b2, b1, 'returns a new reference' );
- t.strictEqual( b2.byteLength, 0, 'has expected number of bytes' );
-
- b2 = b1.slice( -2 );
- t.strictEqual( instanceOf( b2, Ctor ), true, 'returns an instance' );
- t.notEqual( b2, b1, 'returns a new reference' );
- t.strictEqual( b2.byteLength, 2, 'has expected number of bytes' );
-
- b2 = b1.slice( -100 );
- t.strictEqual( instanceOf( b2, Ctor ), true, 'returns an instance' );
- t.notEqual( b2, b1, 'returns a new reference' );
- t.strictEqual( b2.byteLength, 10, 'has expected number of bytes' );
-
- b2 = b1.slice( 0, 6 );
- t.strictEqual( instanceOf( b2, Ctor ), true, 'returns an instance' );
- t.notEqual( b2, b1, 'returns a new reference' );
- t.strictEqual( b2.byteLength, 6, 'has expected number of bytes' );
-
- b2 = b1.slice( 2, 6 );
- t.strictEqual( instanceOf( b2, Ctor ), true, 'returns an instance' );
- t.notEqual( b2, b1, 'returns a new reference' );
- t.strictEqual( b2.byteLength, 4, 'has expected number of bytes' );
-
- b2 = b1.slice( 0, -2 );
- t.strictEqual( instanceOf( b2, Ctor ), true, 'returns an instance' );
- t.notEqual( b2, b1, 'returns a new reference' );
- t.strictEqual( b2.byteLength, 8, 'has expected number of bytes' );
-
- b2 = b1.slice( 0, -100 );
- t.strictEqual( instanceOf( b2, Ctor ), true, 'returns an instance' );
- t.notEqual( b2, b1, 'returns a new reference' );
- t.strictEqual( b2.byteLength, 0, 'has expected number of bytes' );
-
- b2 = b1.slice( -4, -2 );
- t.strictEqual( instanceOf( b2, Ctor ), true, 'returns an instance' );
- t.notEqual( b2, b1, 'returns a new reference' );
- t.strictEqual( b2.byteLength, 2, 'has expected number of bytes' );
-
- t.end();
-});
-
-// TODO: add tests testing shared memory semantics/behavior
diff --git a/test/test.polyfill.js b/test/test.polyfill.js
deleted file mode 100644
index 3cc5d54..0000000
--- a/test/test.polyfill.js
+++ /dev/null
@@ -1,42 +0,0 @@
-/**
-* @license Apache-2.0
-*
-* Copyright (c) 2018 The Stdlib Authors.
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-'use strict';
-
-// MODULES //
-
-var tape = require( 'tape' );
-var ctor = require( './../lib/polyfill.js' );
-
-
-// TESTS //
-
-tape( 'main export is a function', function test( t ) {
- t.ok( true, __filename );
- t.strictEqual( typeof ctor, 'function', 'main export is a function' );
- t.end();
-});
-
-tape( 'the function throws an error when invoked', function test( t ) {
- t.throws( foo, Error, 'throws an error' );
- t.end();
-
- function foo() {
- var f = new ctor(); // eslint-disable-line no-unused-vars
- }
-});
pFad - Phonifier reborn
Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies:
Alternative Proxy
pFad Proxy
pFad v3 Proxy
pFad v4 Proxy