Skip to content

Commit

Permalink
[Fix] ensure main entry point properly checks the receiver in ES3 eng…
Browse files Browse the repository at this point in the history
…ines
  • Loading branch information
ljharb committed Apr 24, 2022
1 parent c6008ea commit 24220c4
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions index.js
Expand Up @@ -2,17 +2,22 @@

var callBind = require('call-bind');
var define = require('define-properties');
var RequireObjectCoercible = require('es-abstract/2021/RequireObjectCoercible');

var implementation = require('./implementation');
var getPolyfill = require('./polyfill');
var shim = require('./shim');

var boundTrim = callBind(getPolyfill());
var bound = callBind(getPolyfill());
var boundMethod = function trim(receiver) {
RequireObjectCoercible(receiver);
return bound(receiver);
};

define(boundTrim, {
define(boundMethod, {
getPolyfill: getPolyfill,
implementation: implementation,
shim: shim
});

module.exports = boundTrim;
module.exports = boundMethod;

0 comments on commit 24220c4

Please sign in to comment.