fix tabs and spaces

This commit is contained in:
Erik Krogh Kristensen
2019-12-09 16:06:17 +01:00
parent 110302678c
commit 60a825cf66
2 changed files with 38 additions and 38 deletions

View File

@@ -112,9 +112,9 @@ module Electron {
*/
class ProcessSender extends Process {
ProcessSender() {
exists(IPCSendRegistration reg | reg.getEmitter() instanceof MainProcess |
this = reg.getABoundCallbackParameter(1, 0).getAPropertyRead("sender")
)
exists(IPCSendRegistration reg | reg.getEmitter() instanceof MainProcess |
this = reg.getABoundCallbackParameter(1, 0).getAPropertyRead("sender")
)
}
}
@@ -127,15 +127,15 @@ module Electron {
override Process emitter;
IPCSendRegistration() {
this = emitter.ref().getAMethodCall("on")
this = emitter.ref().getAMethodCall("on")
}
override string getChannel() {
this.getArgument(0).mayHaveStringValue(result)
this.getArgument(0).mayHaveStringValue(result)
}
override DataFlow::Node getCallbackParameter(int i) {
result = this.getABoundCallbackParameter(1, i + 1)
result = this.getABoundCallbackParameter(1, i + 1)
}
override DataFlow::Node getAReturnedValue(EventEmitter::EventDispatch dispatch) {
@@ -150,16 +150,16 @@ module Electron {
* And a value can be returned through the `returnValue` property of the event (first parameter in the callback).
*/
class IPCDispatch extends EventEmitter::EventDispatch, DataFlow::InvokeNode {
override Process emitter;
override Process emitter;
IPCDispatch() {
exists(string methodName | methodName = "sendSync" or methodName = "send" |
this = emitter.ref().getAMemberCall(methodName)
)
exists(string methodName | methodName = "sendSync" or methodName = "send" |
this = emitter.ref().getAMemberCall(methodName)
)
}
override string getChannel() {
this.getArgument(0).mayHaveStringValue(result)
this.getArgument(0).mayHaveStringValue(result)
}
/**
@@ -168,19 +168,19 @@ module Electron {
* therefore these arguments start at 1.
*/
override DataFlow::Node getDispatchedArgument(int i) {
i >= 1 and
result = getArgument(i)
i >= 1 and
result = getArgument(i)
}
/**
* Holds if this dispatch can send an event to the given EventRegistration destination.
*/
override predicate canSendTo(EventEmitter::EventRegistration destination) {
this.getEmitter() instanceof RendererProcess and
destination.getEmitter() instanceof MainProcess
or
this.getEmitter() instanceof ProcessSender and
destination.getEmitter() instanceof RendererProcess
this.getEmitter() instanceof RendererProcess and
destination.getEmitter() instanceof MainProcess
or
this.getEmitter() instanceof ProcessSender and
destination.getEmitter() instanceof RendererProcess
}
}
}

View File

@@ -24,7 +24,7 @@ module EventEmitter {
* Extend this class to mark something as being instanceof the EventEmitter class.
*/
abstract class EventEmitter extends DataFlow::Node {
/**
/**
* Get a method name that returns `this` on this type of emitter.
*/
string getAChainableMethod() { result = EventEmitter::chainableMethod() }
@@ -45,7 +45,7 @@ module EventEmitter {
)
)
}
/**
* Get a reference through type-tracking to this EventEmitter.
* The type-tracking tracks through chainable methods.
@@ -57,13 +57,13 @@ module EventEmitter {
* A registration of an event handler on a particular EventEmitter.
*/
abstract class EventRegistration extends DataFlow::Node {
EventEmitter emitter;
/** Gets the EventEmitter that the event handler is registered on. */
final EventEmitter getEmitter() {
result = emitter
}
EventEmitter emitter;
/** Gets the EventEmitter that the event handler is registered on. */
final EventEmitter getEmitter() {
result = emitter
}
/** Gets the name of the channel if possible. */
abstract string getChannel();
@@ -82,15 +82,15 @@ module EventEmitter {
*/
abstract class EventDispatch extends DataFlow::Node {
EventEmitter emitter;
/** Gets the emitter that the event dispatch happens on. */
final EventEmitter getEmitter() {
result = emitter
}
/** Gets the emitter that the event dispatch happens on. */
final EventEmitter getEmitter() {
result = emitter
}
/** Gets the name of the channel if possible. */
abstract string getChannel();
/** Gets the `i`th argument that is send to the event handler. */
abstract DataFlow::Node getDispatchedArgument(int i);
@@ -148,7 +148,7 @@ module EventEmitter {
override string getChannel() { this.getArgument(0).mayHaveStringValue(result) }
override DataFlow::Node getCallbackParameter(int i) {
result = this.(DataFlow::MethodCallNode).getABoundCallbackParameter(1, i)
result = this.(DataFlow::MethodCallNode).getABoundCallbackParameter(1, i)
}
}
@@ -156,9 +156,9 @@ module EventEmitter {
override EventEmitter emitter;
EventEmitterDispatch() {
this = emitter.ref().getAMethodCall("emit")
this = emitter.ref().getAMethodCall("emit")
}
override string getChannel() { this.getArgument(0).mayHaveStringValue(result) }
override DataFlow::Node getDispatchedArgument(int i) { result = this.getArgument(i + 1) }