Skip to content
This repository has been archived by the owner on Dec 14, 2022. It is now read-only.

Add Symbol.toStringTag for each class #58

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lionkunonly
Copy link
Contributor

This PR can fix all the failed cases caused by using String to check class.
The sample looks like:

  it('readNetwork should return a Network object', async () => {
    expect(await core.readNetwork(model_path, weights_path)).to.be.a('Network');
  });

This case is failed before the PR. And the PR fixes all similar failed test cases.

@@ -101,4 +106,8 @@ Napi::Value Blob::Size(const Napi::CallbackInfo& info) {
return Napi::Number::New(env, actual_->size());
}

Napi::Value Blob::toStringTag(const Napi::CallbackInfo& info) {
return Napi::String::From(info.Env(), "Blob");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about adding more information? for example bytesize:
"Blob of N byte" or something like this

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not understand your comment clearly. Do you mean that we should an object that contains more information?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exactly

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. You cam share your ideas for related information in this comment. I will try to add them in this PR in next few days. Thanks.

@@ -198,4 +202,8 @@ Napi::Value Core::GetAvailableDevices(const Napi::CallbackInfo& info) {
return available_devices;
}

Napi::Value Core::toStringTag(const Napi::CallbackInfo& info) {
return Napi::String::From(info.Env(), "Core");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest "OpenVINO Inference Engine Core"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is easy to finish it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants