GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — src,tools: remove null sentinel from source array · nodejs/node@e0eebf4

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • src
    • node_javascript.cc
  • tools
    • js2c.py
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/node_javascript.cc‎

Copy file name to clipboardExpand all lines: src/node_javascript.cc
+5-10Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,6 @@
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-
127
namespace node {
138

149
using v8::HandleScope;
@@ -26,13 +21,13 @@ Local<String> MainSource(Environment* env) {
2621
void 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
}
Collapse file

‎tools/js2c.py‎

Copy file name to clipboardExpand all lines: tools/js2c.py
+1-7Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.