@stdlib/function-ctor
Advanced tools
Comparing version 0.1.1 to 0.2.0
{ | ||
"name": "@stdlib/function-ctor", | ||
"version": "0.1.1", | ||
"version": "0.2.0", | ||
"description": "Function constructor.", | ||
@@ -41,6 +41,7 @@ "license": "Apache-2.0", | ||
"devDependencies": { | ||
"@stdlib/bench": "^0.1.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" | ||
"tap-min": "git+https://github.com/Planeshifter/tap-min.git", | ||
"@stdlib/bench-harness": "^0.1.2", | ||
"@stdlib/bench": "^0.3.1" | ||
}, | ||
@@ -47,0 +48,0 @@ "engines": { |
@@ -138,8 +138,15 @@ <!-- | ||
<!-- eslint-disable no-invalid-this --> | ||
```javascript | ||
function add( x, y ) { | ||
return x + y; | ||
return this.initial + x + y; | ||
} | ||
var v = add.apply( null, [ 1, 2 ] ); | ||
// returns 3 | ||
var ctx = { | ||
'initial': 10 | ||
}; | ||
var v = add.apply( ctx, [ 1, 2 ] ); | ||
// returns 13 | ||
``` | ||
@@ -169,9 +176,15 @@ | ||
<!-- eslint-disable no-invalid-this --> | ||
```javascript | ||
function add( x, y ) { | ||
return x + y; | ||
return this.initial + x + y; | ||
} | ||
var v = add.call( null, 1, 2 ); | ||
// returns 3 | ||
var ctx = { | ||
'initial': 10 | ||
}; | ||
var v = add.call( ctx, 1, 2 ); | ||
// returns 13 | ||
``` | ||
@@ -275,3 +288,3 @@ | ||
Copyright © 2016-2023. The Stdlib [Authors][stdlib-authors]. | ||
Copyright © 2016-2024. The Stdlib [Authors][stdlib-authors]. | ||
@@ -289,4 +302,4 @@ </section> | ||
[test-image]: https://github.com/stdlib-js/function-ctor/actions/workflows/test.yml/badge.svg?branch=v0.1.1 | ||
[test-url]: https://github.com/stdlib-js/function-ctor/actions/workflows/test.yml?query=branch:v0.1.1 | ||
[test-image]: https://github.com/stdlib-js/function-ctor/actions/workflows/test.yml/badge.svg?branch=v0.2.0 | ||
[test-url]: https://github.com/stdlib-js/function-ctor/actions/workflows/test.yml?query=branch:v0.2.0 | ||
@@ -314,4 +327,7 @@ [coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/function-ctor/main.svg | ||
[deno-url]: https://github.com/stdlib-js/function-ctor/tree/deno | ||
[deno-readme]: https://github.com/stdlib-js/function-ctor/blob/deno/README.md | ||
[umd-url]: https://github.com/stdlib-js/function-ctor/tree/umd | ||
[umd-readme]: https://github.com/stdlib-js/function-ctor/blob/umd/README.md | ||
[esm-url]: https://github.com/stdlib-js/function-ctor/tree/esm | ||
[esm-readme]: https://github.com/stdlib-js/function-ctor/blob/esm/README.md | ||
[branches-url]: https://github.com/stdlib-js/function-ctor/blob/main/branches.md | ||
@@ -318,0 +334,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
27917
337
5