Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A few more minor improvements #1788

Merged
merged 5 commits into from
Nov 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions test-app/runtime/src/main/cpp/MetadataNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -671,9 +671,9 @@ vector<MetadataNode::MethodCallbackData *> MetadataNode::SetInstanceMethodsFromS

MetadataNode::MethodCallbackData *MetadataNode::tryGetExtensionMethodCallbackData(
std::unordered_map<std::string, MethodCallbackData *> collectedMethodCallbackDatas,
std::string lookupName) {
const std::string& lookupName) {

if (collectedMethodCallbackDatas.size() < 1) {
if (collectedMethodCallbackDatas.empty()) {
return nullptr;
}

Expand Down Expand Up @@ -1053,7 +1053,6 @@ Local<FunctionTemplate> MetadataNode::GetConstructorFunctionTemplate(Isolate* is
// insert isolate-specific persistent function handle
node->m_poCtorCachePerIsolate.insert({isolate, new Persistent<Function>(isolate, wrappedCtorFunc)});
if (!baseCtorFunc.IsEmpty()) {
auto context = isolate->GetCurrentContext();
wrappedCtorFunc->SetPrototype(context, baseCtorFunc);
}

Expand Down Expand Up @@ -2039,7 +2038,7 @@ void MetadataNode::EnableProfiler(bool enableProfiler) {
s_profilerEnabled = enableProfiler;
}

bool MetadataNode::IsJavascriptKeyword(std::string word) {
bool MetadataNode::IsJavascriptKeyword(const std::string& word) {
static set<string> keywords{
"abstract", "arguments", "boolean", "break", "byte", "case", "catch", "char", "class", "const", "continue", "debugger", "default", "delete", "do",
"double", "else", "enum", "eval", "export", "extends", "false", "final", "finally", "float", "for", "function", "goto", "if", "implements",
Expand Down
4 changes: 2 additions & 2 deletions test-app/runtime/src/main/cpp/MetadataNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class MetadataNode {

MetadataNode(MetadataTreeNode* treeNode);

static bool IsJavascriptKeyword(std::string word);
static bool IsJavascriptKeyword(const std::string& word);
v8::Local<v8::Object> CreatePackageObject(v8::Isolate* isolate);

v8::Local<v8::Function> GetConstructorFunction(v8::Isolate* isolate);
Expand All @@ -97,7 +97,7 @@ class MetadataNode {
MetadataTreeNode* treeNode);
static MethodCallbackData* tryGetExtensionMethodCallbackData(
std::unordered_map<std::string, MethodCallbackData*> collectedMethodCallbackDatas,
std::string lookupName);
const std::string& lookupName);
void SetInstanceFieldsFromStaticMetadata(
v8::Isolate* isolate, PrototypeTemplateFiller& protoFiller,
MetadataTreeNode* treeNode);
Expand Down
4 changes: 0 additions & 4 deletions test-app/runtime/src/main/cpp/ObjectManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -287,10 +287,6 @@ Local<Object> ObjectManager::GetEmptyObject(Isolate *isolate) {
return m_wrapperObjectTemplate.Get(isolate)->NewInstance(context).ToLocalChecked();
}

void ObjectManager::JSWrapperConstructorCallback(const v8::FunctionCallbackInfo<v8::Value> &info) {
assert(info.IsConstructCall());
}

void ObjectManager::ReleaseNativeCounterpart(v8::Local<v8::Object> &object) {

if(!object->IsObject()){
Expand Down
2 changes: 0 additions & 2 deletions test-app/runtime/src/main/cpp/ObjectManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,6 @@ class ObjectManager {

static void DeleteWeakGlobalRefCallback(const jweak& object, void* state);

static void JSWrapperConstructorCallback(const v8::FunctionCallbackInfo<v8::Value>& info);

static bool IsJsRuntimeObject(const v8::Local<v8::Object>& object);

jobject m_javaRuntimeObject;
Expand Down

This file was deleted.

Loading
Loading