Skip to content

Commit b788908

Browse files
committed
replace internals/math-log2 with module dependency
1 parent 54b5a9c commit b788908

File tree

3 files changed

+9
-14
lines changed

3 files changed

+9
-14
lines changed

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

Lines changed: 0 additions & 10 deletions
This file was deleted.
Lines changed: 6 additions & 2 deletions
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

Lines changed: 3 additions & 2 deletions
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)