Skip to content

Commit

Permalink
replace internals/math-log2 with module dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
zloirock committed Dec 24, 2024
1 parent 54b5a9c commit b788908
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 14 deletions.
10 changes: 0 additions & 10 deletions packages/core-js/internals/math-log2.js

This file was deleted.

8 changes: 6 additions & 2 deletions packages/core-js/modules/es.math.log2.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
'use strict';
var $ = require('../internals/export');
var log2 = require('../internals/math-log2');

var log = Math.log;
var LN2 = Math.LN2;

// `Math.log2` method
// https://tc39.es/ecma262/#sec-math.log2
$({ target: 'Math', stat: true }, {
log2: log2,
log2: function log2(x) {
return log(x) / LN2;
},
});
5 changes: 3 additions & 2 deletions packages/core-js/modules/esnext.data-view.set-float16.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
'use strict';
var $ = require('../internals/export');
var getBuiltInStaticMethod = require('../internals/get-built-in-static-method');
var uncurryThis = require('../internals/function-uncurry-this');
var aDataView = require('../internals/a-data-view');
var toIndex = require('../internals/to-index');
// TODO: Replace with module dependency in `core-js@4`
var log2 = require('../internals/math-log2');
var roundTiesToEven = require('../internals/math-round-ties-to-even');

// dependency: es.math.log2
var log2 = getBuiltInStaticMethod('Math', 'log2');
var pow = Math.pow;

var MIN_INFINITY16 = 65520; // (2 - 2 ** -11) * 2 ** 15
Expand Down

0 comments on commit b788908

Please sign in to comment.