Permalink
Cannot retrieve contributors at this time
19 lines (14 sloc)
578 Bytes
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
codeql-action/node_modules/es-abstract/2022/Number/bitwiseNOT.js
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
var GetIntrinsic = require('get-intrinsic'); | |
var $TypeError = GetIntrinsic('%TypeError%'); | |
var ToInt32 = require('../ToInt32'); | |
var Type = require('../Type'); | |
// https://262.ecma-international.org/11.0/#sec-numeric-types-number-bitwiseNOT | |
module.exports = function NumberBitwiseNOT(x) { | |
if (Type(x) !== 'Number') { | |
throw new $TypeError('Assertion failed: `x` argument must be a Number'); | |
} | |
var oldValue = ToInt32(x); | |
// Return the result of applying the bitwise operator op to lnum and rnum. The result is a signed 32-bit integer. | |
return ~oldValue; | |
}; |