File tree Expand file tree Collapse file tree 3 files changed +1
-40
lines changed
Include/Babylon/Polyfills Expand file tree Collapse file tree 3 files changed +1
-40
lines changed Original file line number Diff line number Diff line change 11#pragma once
22
33#include < napi/env.h>
4- #include < napi/napi.h>
54#include < Babylon/Api.h>
6- #include < vector>
7- #include < string>
85
96namespace Babylon ::Polyfills::Blob
107{
118 void BABYLON_API Initialize (Napi::Env env);
12-
13- Napi::Value BABYLON_API CreateInstance (
14- Napi::Env env,
15- std::vector<std::byte> data,
16- std::string type);
179}
Original file line number Diff line number Diff line change 44
55namespace Babylon ::Polyfills::Internal
66{
7- static constexpr auto JS_BLOB_CONSTRUCTOR_NAME = " Blob" ;
8-
97 void Blob::Initialize (Napi::Env env)
108 {
9+ static constexpr auto JS_BLOB_CONSTRUCTOR_NAME = " Blob" ;
1110 if (env.Global ().Get (JS_BLOB_CONSTRUCTOR_NAME).IsUndefined ())
1211 {
1312 Napi::Function func = DefineClass (
@@ -25,23 +24,6 @@ namespace Babylon::Polyfills::Internal
2524 }
2625 }
2726
28- Napi::Value Blob::CreateInstance (
29- Napi::Env env,
30- std::vector<std::byte> data,
31- std::string type)
32- {
33- Initialize (env);
34-
35- auto ctor{env.Global ().Get (JS_BLOB_CONSTRUCTOR_NAME).As <Napi::Function>()};
36- auto jsBlob{ctor.New ({})};
37-
38- auto blob{Blob::Unwrap (jsBlob)};
39- blob->m_data = std::move (data);
40- blob->m_type = std::move (type);
41-
42- return jsBlob;
43- }
44-
4527 Blob::Blob (const Napi::CallbackInfo& info)
4628 : Napi::ObjectWrap<Blob>(info)
4729 {
@@ -151,12 +133,4 @@ namespace Babylon::Polyfills::Blob
151133 {
152134 Internal::Blob::Initialize (env);
153135 }
154-
155- Napi::Value BABYLON_API CreateInstance (
156- Napi::Env env,
157- std::vector<std::byte> data,
158- std::string type)
159- {
160- return Internal::Blob::CreateInstance (env, std::move (data), std::move (type));
161- }
162136}
Original file line number Diff line number Diff line change @@ -12,11 +12,6 @@ namespace Babylon::Polyfills::Internal
1212 public:
1313 static void Initialize (Napi::Env env);
1414
15- static Napi::Value CreateInstance (
16- Napi::Env env,
17- std::vector<std::byte> data,
18- std::string type);
19-
2015 explicit Blob (const Napi::CallbackInfo& info);
2116
2217 private:
You can’t perform that action at this time.
0 commit comments