Uname:Linux mail.sarafai.ru 6.1.0-43-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.162-1 (2026-02-08) x86_64

403WebShell
403Webshell
Server IP : 82.148.16.210  /  Your IP : 216.73.216.32
Web Server : nginx/1.29.5
System : Linux mail.sarafai.ru 6.1.0-43-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.162-1 (2026-02-08) x86_64
User : www-data ( 33)
PHP Version : 7.4.33
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : OFF
Directory :  /srv/projects/env4/src/dev/frontend3/node_modules/table/node_modules/re2/lib/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /srv/projects/env4/src/dev/frontend3/node_modules/table/node_modules/re2/lib/util.cc
#include "./util.h"

#include <sys/types.h>
#include <string>

#include <node_buffer.h>

StrVal::StrVal(const v8::Local<v8::Value> &arg) : data(NULL), size(0), isBuffer(false)
{
	if (node::Buffer::HasInstance(arg))
	{
		isBuffer = true;
		size = length = node::Buffer::Length(arg);
		data = node::Buffer::Data(arg);
	}
	else
	{
		auto t = arg->ToString(Nan::GetCurrentContext());
		if (!t.IsEmpty())
		{
			auto s = t.ToLocalChecked();
			length = Nan::DecodeBytes(s);
			size = Nan::DecodeBytes(s, Nan::UTF8);
			buffer.resize(size + 1);
			data = &buffer[0];
			Nan::DecodeWrite(data, size, s, Nan::UTF8);
			buffer[size] = '\0';
		}
	}
}

void consoleCall(const v8::Local<v8::String> &methodName, v8::Local<v8::Value> text)
{
	auto context = Nan::GetCurrentContext();

	auto maybeConsole = bind<v8::Object>(
		Nan::Get(context->Global(), Nan::New("console").ToLocalChecked()),
		[context](v8::Local<v8::Value> console) { return console->ToObject(context); });
	if (maybeConsole.IsEmpty())
		return;

	auto console = maybeConsole.ToLocalChecked();

	auto maybeMethod = bind<v8::Object>(
		Nan::Get(console, methodName),
		[context](v8::Local<v8::Value> method) { return method->ToObject(context); });
	if (maybeMethod.IsEmpty())
		return;

	auto method = maybeMethod.ToLocalChecked();
	if (!method->IsFunction())
		return;

	Nan::CallAsFunction(method, console, 1, &text);
}

void printDeprecationWarning(const char *warning)
{
	std::string prefixedWarning = "DeprecationWarning: ";
	prefixedWarning += warning;
	consoleCall(Nan::New("error").ToLocalChecked(), Nan::New(prefixedWarning).ToLocalChecked());
}

v8::Local<v8::String> callToString(const v8::Local<v8::Object> &object)
{
	auto context = Nan::GetCurrentContext();

	auto maybeMethod = bind<v8::Object>(
		Nan::Get(object, Nan::New("toString").ToLocalChecked()),
		[context](v8::Local<v8::Value> method) { return method->ToObject(context); });
	if (maybeMethod.IsEmpty())
		return Nan::New("No toString() is found").ToLocalChecked();

	auto method = maybeMethod.ToLocalChecked();
	if (!method->IsFunction())
		return Nan::New("No toString() is found").ToLocalChecked();

	auto maybeResult = Nan::CallAsFunction(method, object, 0, nullptr);
	if (maybeResult.IsEmpty())
	{
		return Nan::New("nothing was returned").ToLocalChecked();
	}

	auto result = maybeResult.ToLocalChecked();

	if (result->IsObject())
	{
		return callToString(result->ToObject(context).ToLocalChecked());
	}

	Nan::Utf8String val(result->ToString(context).ToLocalChecked());
	return Nan::New(std::string(*val, val.length())).ToLocalChecked();
}

Youez - 2016 - github.com/yon3zu
LinuXploit