src,tools: remove null sentinel from source array

PR-URL: https://github.com/nodejs/node/pull/5418
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
This commit is contained in:
Ben Noordhuis committed 2016-02-25 13:21:56 +01:00
1 parent 96adbe9503
commit 33e51fe18c
2 files changed
+6 -17

No files matched your search

+5 -10
View File
@@ -4,11 +4,6 @@
#include "env.h"
#include "env-inl.h"
#include <string.h>
#if !defined(_MSC_VER)
#include <strings.h>
#endif
namespace node {
using v8::HandleScope;
@@ -26,13 +21,13 @@ Local<String> MainSource(Environment* env) {
void DefineJavaScript(Environment* env, Local<Object> target) {
HandleScope scope(env->isolate());
for (int i = 0; natives[i].name; i++) {
if (natives[i].source != node_native) {
Local<String> name = String::NewFromUtf8(env->isolate(), natives[i].name);
for (auto native : natives) {
if (native.source != node_native) {
Local<String> name = String::NewFromUtf8(env->isolate(), native.name);
Local<String> source =
String::NewFromUtf8(
env->isolate(), reinterpret_cast<const char*>(natives[i].source),
NewStringType::kNormal, natives[i].source_len).ToLocalChecked();
env->isolate(), reinterpret_cast<const char*>(native.source),
NewStringType::kNormal, native.source_len).ToLocalChecked();
target->Set(name, source);
}
}