Skip to content

Commit

Permalink
toString revision (#242)
Browse files Browse the repository at this point in the history
* Test Function prototype toString revision (now it doesn't throw).

* Fix linter warning.
  • Loading branch information
LucaFranceschini committed Jul 19, 2023
1 parent 8324e95 commit c3cdece
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/metadata.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ module.exports = class InvocationData {

function defineImmutableProperty (object, key, value) {
Object.defineProperty(object, key, {
value: value,
value,
writable: false,
configurable: false
})
Expand Down
5 changes: 5 additions & 0 deletions test/toString.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,9 @@ describe('toString method', function () {
it('should always return the same toString()', function () {
wrap.the(nop).toString.should.equal(wrap.the(nop).toString)
})

it('should not throw directly calling Function.prototype.toString on wrapped function', function () {
const wrapped = wrap.the(nop)
Function.prototype.toString.call(wrapped)
})
})

0 comments on commit c3cdece

Please sign in to comment.