File tree Expand file tree Collapse file tree 2 files changed +6
-17
lines changed Expand file tree Collapse file tree 2 files changed +6
-17
lines changed Original file line number Diff line number Diff line change 44#include " env.h"
55#include " env-inl.h"
66
7- #include < string.h>
8- #if !defined(_MSC_VER)
9- #include < strings.h>
10- #endif
11-
127namespace node {
138
149using v8::HandleScope;
@@ -26,13 +21,13 @@ Local<String> MainSource(Environment* env) {
2621void DefineJavaScript (Environment* env, Local<Object> target) {
2722 HandleScope scope (env->isolate ());
2823
29- for (int i = 0 ; natives[i]. name ; i++ ) {
30- if (natives[i] .source != node_native) {
31- Local<String> name = String::NewFromUtf8 (env->isolate (), natives[i] .name );
24+ for (auto native : natives) {
25+ if (native .source != node_native) {
26+ Local<String> name = String::NewFromUtf8 (env->isolate (), native .name );
3227 Local<String> source =
3328 String::NewFromUtf8 (
34- env->isolate (), reinterpret_cast <const char *>(natives[i] .source ),
35- NewStringType::kNormal , natives[i] .source_len ).ToLocalChecked ();
29+ env->isolate (), reinterpret_cast <const char *>(native .source ),
30+ NewStringType::kNormal , native .source_len ).ToLocalChecked ();
3631 target->Set (name, source);
3732 }
3833 }
Original file line number Diff line number Diff line change @@ -207,13 +207,7 @@ def ReadMacros(lines):
207207 size_t source_len;
208208};
209209
210- static const struct _native natives[] = {
211-
212- %(native_lines)s\
213-
214- { NULL, NULL, 0 } /* sentinel */
215-
216- };
210+ static const struct _native natives[] = { %(native_lines)s };
217211
218212}
219213#endif
You can’t perform that action at this time.
0 commit comments