summaryrefslogtreecommitdiff
path: root/deps/v8/test/js-perf-test/Numbers/toNumber.js
blob: 44382f092be3981265828aabf20d435630f911a7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// Copyright 2018 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
const A = [undefined, 12, "123"];

function NumberConstructor() {
  Number.isNaN(Number(A[0]))
  Number.isNaN(Number(A[1]))
  Number.isNaN(Number(A[2]))
}
createSuite('Constructor', 1000, NumberConstructor, ()=>{});

function NumberPlus() {
  Number.isNaN(+(A[0]))
  Number.isNaN(+(A[1]))
  Number.isNaN(+(A[2]))
}
createSuite('UnaryPlus', 1000, NumberPlus, ()=>{});

function NumberParseFloat() {
  Number.isNaN(parseFloat(A[0]))
  Number.isNaN(parseFloat(A[1]))
  Number.isNaN(parseFloat(A[2]))
}
createSuite('ParseFloat', 1000, NumberParseFloat, ()=>{});