Permalink
Cannot retrieve contributors at this time
31 lines (24 sloc)
617 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/concordance/lib/metaDescriptors/pointer.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' | |
const UNEQUAL = require('../constants').UNEQUAL | |
function describe (index) { | |
return new Pointer(index) | |
} | |
exports.describe = describe | |
exports.deserialize = describe | |
const tag = Symbol('Pointer') | |
exports.tag = tag | |
class Pointer { | |
constructor (index) { | |
this.index = index | |
} | |
// Pointers cannot be compared, and are not expected to be part of the | |
// comparisons. | |
compare (expected) { | |
return UNEQUAL | |
} | |
serialize () { | |
return this.index | |
} | |
} | |
Object.defineProperty(Pointer.prototype, 'isPointer', { value: true }) | |
Object.defineProperty(Pointer.prototype, 'tag', { value: tag }) |