Skip to content

Commit 5eb34c0

Browse files
committed
replace internals/math-log2 with module dependency
1 parent 160e1ba commit 5eb34c0

File tree

3 files changed

+9
-14
lines changed

3 files changed

+9
-14
lines changed

packages/core-js/internals/math-log2.js

-10
This file was deleted.
+6-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
'use strict';
22
var $ = require('../internals/export');
3-
var log2 = require('../internals/math-log2');
3+
4+
var log = Math.log;
5+
var LN2 = Math.LN2;
46

57
// `Math.log2` method
68
// https://tc39.es/ecma262/#sec-math.log2
79
$({ target: 'Math', stat: true }, {
8-
log2: log2,
10+
log2: function log2(x) {
11+
return log(x) / LN2;
12+
},
913
});

packages/core-js/modules/esnext.data-view.set-float16.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
'use strict';
22
var $ = require('../internals/export');
3+
var getBuiltInStaticMethod = require('../internals/get-built-in-static-method');
34
var uncurryThis = require('../internals/function-uncurry-this');
45
var aDataView = require('../internals/a-data-view');
56
var toIndex = require('../internals/to-index');
6-
// TODO: Replace with module dependency in `core-js@4`
7-
var log2 = require('../internals/math-log2');
87
var roundTiesToEven = require('../internals/math-round-ties-to-even');
98

9+
// dependency: es.math.log2
10+
var log2 = getBuiltInStaticMethod('Math', 'log2');
1011
var pow = Math.pow;
1112

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

0 commit comments

Comments
 (0)