Skip to content

Commit

Permalink
fix lints
Browse files Browse the repository at this point in the history
  • Loading branch information
uurien committed Oct 17, 2024
1 parent 64a821c commit 3bf166e
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 24 deletions.
3 changes: 1 addition & 2 deletions src/api/array_join.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ namespace api {

const int DEFAULT_JOIN_SEPARATOR_LENGTH = 1;

void copyRangesWithOffset(
Transaction* transaction,
void copyRangesWithOffset(Transaction* transaction,
SharedRanges* origRanges,
SharedRanges** destRanges,
int offset) {
Expand Down
20 changes: 10 additions & 10 deletions src/api/replace.cc
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ struct MatcherArguments {
};

inline void addReplacerRanges(Transaction* transaction,
SharedRanges* replacerRanges,
int toReplaceStart,
SharedRanges* newRanges) {
SharedRanges* replacerRanges,
int toReplaceStart,
SharedRanges* newRanges) {
if (replacerRanges) {
if (toReplaceStart == 0) {
newRanges->Add(replacerRanges);
Expand All @@ -65,9 +65,9 @@ inline void addReplacerRanges(Transaction* transaction,
}

inline SharedRanges* adjustReplacementRanges(Transaction* transaction,
SharedRanges* subjectRanges,
SharedRanges* replacerRanges,
const MatcherArguments& args) {
SharedRanges* subjectRanges,
SharedRanges* replacerRanges,
const MatcherArguments& args) {
auto matcherLength = String::Cast(*(args.matcher))->Length();
auto replacementLength = String::Cast(*(args.replacer))->Length();
auto toReplaceStart = Integer::Cast(*(args.replacements))->Value();
Expand Down Expand Up @@ -120,10 +120,10 @@ inline SharedRanges* adjustReplacementRanges(Transaction* transaction,
}

inline SharedRanges* adjustRegexReplacementRanges(Transaction* transaction,
SharedRanges* subjectRanges,
SharedRanges* replacerRanges,
const MatcherArguments& args,
Local<Context> context) {
SharedRanges* subjectRanges,
SharedRanges* replacerRanges,
const MatcherArguments& args,
Local<Context> context) {
std::vector<Range*>::iterator subjectIt;
std::vector<Range*>::iterator subjectItEnd;
auto replacerLen = String::Cast(*(args.replacer))->Length();
Expand Down
2 changes: 1 addition & 1 deletion src/tainted/input_info.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ using v8::Isolate;
namespace iast {
namespace tainted {
InputInfo::InputInfo(v8::Local<v8::Value> parameterName,
v8::Local<v8::Value> parameterValue, v8::Local<v8::Value> type) {
v8::Local<v8::Value> parameterValue, v8::Local<v8::Value> type) {
Isolate *isolate = v8::Isolate::GetCurrent();
this->parameterName.Reset(isolate, parameterName);
this->parameterValue.Reset(isolate, parameterValue);
Expand Down
6 changes: 3 additions & 3 deletions src/tainted/input_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ class InputInfoV8Container {

struct InputInfo {
InputInfo(v8::Local<v8::Value> parameterName,
v8::Local<v8::Value> parameterValue, v8::Local<v8::Value> type);
v8::Local<v8::Value> parameterValue, v8::Local<v8::Value> type);

InputInfo(const InputInfo& inputInfo);
~InputInfo();

Expand All @@ -36,8 +37,7 @@ struct InputInfo {
InputInfo* GetInputInfoFromJsObject(v8::Object* jsInputInfo, v8::Isolate* isolate, v8::Local<v8::Context> context);

v8::Local<v8::Object> GetJsObjectFromInputInfo(v8::Isolate* isolate,
v8::Local<v8::Context> context,
InputInfo *inputInfo);
v8::Local<v8::Context> context, InputInfo *inputInfo);
} // namespace tainted
} // namespace iast
#endif // SRC_TAINTED_INPUT_INFO_H_
3 changes: 1 addition & 2 deletions src/tainted/tainted_object.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ TaintedObject::TaintedObject() {
}

TaintedObject::TaintedObject(weak_key_t pointerToV8String,
SharedRanges* ranges,
v8::Local<v8::Value> jsString): _ranges(ranges) {
SharedRanges* ranges,v8::Local<v8::Value> jsString): _ranges(ranges) {
this->_key = pointerToV8String;
this->_next = nullptr;
this->target.Reset(v8::Isolate::GetCurrent(), jsString);
Expand Down
3 changes: 1 addition & 2 deletions src/tainted/transaction.cc
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@ void Transaction::cleanSharedVectors() {
}

InputInfo* Transaction::createNewInputInfo(v8::Local<v8::Value> parameterName,
v8::Local<v8::Value> parameterValue,
v8::Local<v8::Value> type) {
v8::Local<v8::Value> parameterValue, v8::Local<v8::Value> type) {
InputInfo* newInputInfo = new InputInfo(parameterName, parameterValue, type);
if (newInputInfo != nullptr) {
_usedInputInfo.push_back(newInputInfo);
Expand Down
4 changes: 2 additions & 2 deletions src/utils/jsobject_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ char* GetCharsFromV8Value(v8::Isolate* isolate, v8::Local<v8::Value> value) {
}

char* GetCharsFromV8ObjectProperty(v8::Isolate* isolate, v8::Local<v8::Context> context,
v8::Object* v8Object, const char* propertyName) {
v8::Object* v8Object, const char* propertyName) {
auto jsPropertyValue = v8Object->Get(context, NewV8String(isolate, propertyName)).ToLocalChecked();
return GetCharsFromV8Value(isolate, jsPropertyValue);
}

int GetIntFromV8ObjectProperty(v8::Isolate* isolate, v8::Local<v8::Context> context,
v8::Object* v8Object, const char* propertyName) {
v8::Object* v8Object, const char* propertyName) {
auto jsPropertyValue = v8Object->Get(context, NewV8String(isolate, propertyName)).ToLocalChecked();
return v8::Number::Cast(*jsPropertyValue)->Value();
}
Expand Down
9 changes: 7 additions & 2 deletions src/utils/jsobject_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,17 @@
namespace iast {
namespace utils {
v8::Local<v8::Value> NewV8String(v8::Isolate* isolate, const char* keyName);

char* GetCharsFromV8Value(v8::Isolate* isolate, v8::Local<v8::Value> value);

char* GetCharsFromV8ObjectProperty(v8::Isolate* isolate, v8::Local<v8::Context> context,
v8::Object* v8Object, const char* propertyName);
v8::Object* v8Object, const char* propertyName);

int GetIntFromV8ObjectProperty(v8::Isolate* isolate, v8::Local<v8::Context> context,
v8::Object* v8Object, const char* propertyName);
v8::Object* v8Object, const char* propertyName);

bool IsExternal(v8::String* originalString);

void CopyCharArrToUint16Arr(const char* charArr, uint16_t* result);
} // namespace utils
} // namespace iast
Expand Down

0 comments on commit 3bf166e

Please sign in to comment.