Skip to content

Commit e767aa1

Browse files
committed
Revert "src: make process.env.TZ setter clear tz cache"
This reverts commit 1d1ab76. PR-URL: #20228 Fixes: #20227 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 0f8caf2 commit e767aa1

File tree

2 files changed

+0
-33
lines changed

2 files changed

+0
-33
lines changed

src/node.cc

-10
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@
8080
#include <stdlib.h>
8181
#include <string.h>
8282
#include <sys/types.h>
83-
#include <time.h> // tzset(), _tzset()
8483

8584
#include <string>
8685
#include <vector>
@@ -136,7 +135,6 @@ using v8::Array;
136135
using v8::ArrayBuffer;
137136
using v8::Boolean;
138137
using v8::Context;
139-
using v8::Date;
140138
using v8::EscapableHandleScope;
141139
using v8::Exception;
142140
using v8::Float64Array;
@@ -2690,10 +2688,6 @@ static void EnvSetter(Local<Name> property,
26902688
node::Utf8Value key(info.GetIsolate(), property);
26912689
node::Utf8Value val(info.GetIsolate(), value);
26922690
setenv(*key, *val, 1);
2693-
if (key.length() == 2 && key[0] == 'T' && key[1] == 'Z') {
2694-
tzset();
2695-
Date::DateTimeConfigurationChangeNotification(info.GetIsolate());
2696-
}
26972691
#else // _WIN32
26982692
node::TwoByteValue key(info.GetIsolate(), property);
26992693
node::TwoByteValue val(info.GetIsolate(), value);
@@ -2702,10 +2696,6 @@ static void EnvSetter(Local<Name> property,
27022696
if (key_ptr[0] != L'=') {
27032697
SetEnvironmentVariableW(key_ptr, reinterpret_cast<WCHAR*>(*val));
27042698
}
2705-
if (key.length() == 2 && key[0] == L'T' && key[1] == L'Z') {
2706-
_tzset();
2707-
Date::DateTimeConfigurationChangeNotification(info.GetIsolate());
2708-
}
27092699
#endif
27102700
// Whether it worked or not, always return value.
27112701
info.GetReturnValue().Set(value);

test/parallel/test-process-env-tz.js

-23
This file was deleted.

0 commit comments

Comments
 (0)