mirror of
https://github.com/github/codeql.git
synced 2026-04-30 11:15:13 +02:00
JS: Factor out Unit type
This commit is contained in:
10
javascript/ql/src/semmle/javascript/Unit.qll
Normal file
10
javascript/ql/src/semmle/javascript/Unit.qll
Normal file
@@ -0,0 +1,10 @@
|
||||
/** Provides the `Unit` class. */
|
||||
|
||||
/** The unit type. */
|
||||
private newtype TUnit = TMkUnit()
|
||||
|
||||
/** The trivial type with a single element. */
|
||||
class Unit extends TUnit {
|
||||
/** Gets a textual representation of this element. */
|
||||
string toString() { result = "Unit" }
|
||||
}
|
||||
@@ -72,7 +72,7 @@ private import javascript
|
||||
private import internal.FlowSteps
|
||||
private import internal.AccessPaths
|
||||
private import internal.CallGraphs
|
||||
private import internal.Unit
|
||||
private import semmle.javascript.Unit
|
||||
private import semmle.javascript.internal.CachedStages
|
||||
|
||||
/**
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
import javascript
|
||||
private import semmle.javascript.dataflow.internal.FlowSteps as FlowSteps
|
||||
private import semmle.javascript.dataflow.internal.Unit
|
||||
private import semmle.javascript.Unit
|
||||
private import semmle.javascript.dataflow.InferredTypes
|
||||
private import semmle.javascript.internal.CachedStages
|
||||
|
||||
|
||||
@@ -4,14 +4,9 @@
|
||||
*/
|
||||
|
||||
private import javascript
|
||||
private import semmle.javascript.Unit
|
||||
private import semmle.javascript.internal.CachedStages
|
||||
|
||||
private newtype TUnit = MkUnit()
|
||||
|
||||
private class Unit extends TUnit {
|
||||
string toString() { result = "unit" }
|
||||
}
|
||||
|
||||
/**
|
||||
* Internal extension point for adding flow edges prior to call graph construction
|
||||
* and type tracking.
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
private newtype TUnit = MkUnit()
|
||||
|
||||
/**
|
||||
* A class with only one instance.
|
||||
*/
|
||||
class Unit extends TUnit {
|
||||
/** Gets a textual representation of this element. */
|
||||
final string toString() { result = "Unit" }
|
||||
}
|
||||
Reference in New Issue
Block a user