| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 0151486 commit 2c95b96
12 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1942,7 +1942,9 @@ void CanonicalizeIP(const FunctionCallbackInfo<Value>& args) { | |||
| 1942 | 1942 | char canonical_ip[INET6_ADDRSTRLEN]; | |
| 1943 | 1943 | const int af = (rc == 4 ? AF_INET : AF_INET6); | |
| 1944 | 1944 | CHECK_EQ(0, uv_inet_ntop(af, &result, canonical_ip, sizeof(canonical_ip))); | |
| 1945 | - args.GetReturnValue().Set(String::NewFromUtf8(isolate, canonical_ip)); | ||
| 1945 | + v8::Local<String> val = String::NewFromUtf8(isolate, canonical_ip, | ||
| 1946 | + v8::NewStringType::kNormal).ToLocalChecked(); | ||
| 1947 | + args.GetReturnValue().Set(val); | ||
| 1946 | 1948 | } | |
| 1947 | 1949 | ||
| 1948 | 1950 | void GetAddrInfo(const FunctionCallbackInfo<Value>& args) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -39,7 +39,8 @@ Local<Value> ErrnoException(Isolate* isolate, | |||
| 39 | 39 | Local<String> path_string; | |
| 40 | 40 | if (path != nullptr) { | |
| 41 | 41 | // FIXME(bnoordhuis) It's questionable to interpret the file path as UTF-8. | |
| 42 | - path_string = String::NewFromUtf8(env->isolate(), path); | ||
| 42 | + path_string = String::NewFromUtf8(env->isolate(), path, | ||
| 43 | + v8::NewStringType::kNormal).ToLocalChecked(); | ||
| 43 | 44 | } | |
| 44 | 45 | ||
| 45 | 46 | if (path_string.IsEmpty() == false) { | |
@@ -68,13 +69,17 @@ static Local<String> StringFromPath(Isolate* isolate, const char* path) { | |||
| 68 | 69 | #ifdef _WIN32 | |
| 69 | 70 | if (strncmp(path, "\\\\?\\UNC\\", 8) == 0) { | |
| 70 | 71 | return String::Concat(FIXED_ONE_BYTE_STRING(isolate, "\\\\"), | |
| 71 | - String::NewFromUtf8(isolate, path + 8)); | ||
| 72 | + String::NewFromUtf8(isolate, path + 8, | ||
| 73 | + v8::NewStringType::kNormal) | ||
| 74 | + .ToLocalChecked()); | ||
| 72 | 75 | } else if (strncmp(path, "\\\\?\\", 4) == 0) { | |
| 73 | - return String::NewFromUtf8(isolate, path + 4); | ||
| 76 | + return String::NewFromUtf8(isolate, path + 4, v8::NewStringType::kNormal) | ||
| 77 | + .ToLocalChecked(); | ||
| 74 | 78 | } | |
| 75 | 79 | #endif | |
| 76 | 80 | ||
| 77 | - return String::NewFromUtf8(isolate, path); | ||
| 81 | + return String::NewFromUtf8(isolate, path, v8::NewStringType::kNormal) | ||
| 82 | + .ToLocalChecked(); | ||
| 78 | 83 | } | |
| 79 | 84 | ||
| 80 | 85 | ||
@@ -183,7 +188,9 @@ Local<Value> WinapiErrnoException(Isolate* isolate, | |||
| 183 | 188 | Local<String> cons1 = | |
| 184 | 189 | String::Concat(message, FIXED_ONE_BYTE_STRING(isolate, " '")); | |
| 185 | 190 | Local<String> cons2 = | |
| 186 | - String::Concat(cons1, String::NewFromUtf8(isolate, path)); | ||
| 191 | + String::Concat(cons1, | ||
| 192 | + String::NewFromUtf8(isolate, path, v8::NewStringType::kNormal) | ||
| 193 | + .ToLocalChecked()); | ||
| 187 | 194 | Local<String> cons3 = | |
| 188 | 195 | String::Concat(cons2, FIXED_ONE_BYTE_STRING(isolate, "'")); | |
| 189 | 196 | e = Exception::Error(cons3); | |
@@ -195,7 +202,9 @@ Local<Value> WinapiErrnoException(Isolate* isolate, | |||
| 195 | 202 | obj->Set(env->errno_string(), Integer::New(isolate, errorno)); | |
| 196 | 203 | ||
| 197 | 204 | if (path != nullptr) { | |
| 198 | - obj->Set(env->path_string(), String::NewFromUtf8(isolate, path)); | ||
| 205 | + obj->Set(env->path_string(), | ||
| 206 | + String::NewFromUtf8(isolate, path, v8::NewStringType::kNormal) | ||
| 207 | + .ToLocalChecked()); | ||
| 199 | 208 | } | |
| 200 | 209 | ||
| 201 | 210 | if (syscall != nullptr) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -965,7 +965,8 @@ void AppendExceptionLine(Environment* env, | |||
| 965 | 965 | arrow[off] = '\n'; | |
| 966 | 966 | arrow[off + 1] = '\0'; | |
| 967 | 967 | ||
| 968 | - Local<String> arrow_str = String::NewFromUtf8(env->isolate(), arrow); | ||
| 968 | + Local<String> arrow_str = String::NewFromUtf8(env->isolate(), arrow, | ||
| 969 | + v8::NewStringType::kNormal).ToLocalChecked(); | ||
| 969 | 970 | ||
| 970 | 971 | const bool can_set_arrow = !arrow_str.IsEmpty() && !err_obj.IsEmpty(); | |
| 971 | 972 | // If allocating arrow_str failed, print it out. There's not much else to do. | |
@@ -1741,7 +1742,8 @@ static void GetLinkedBinding(const FunctionCallbackInfo<Value>& args) { | |||
| 1741 | 1742 | ||
| 1742 | 1743 | Local<Object> module = Object::New(env->isolate()); | |
| 1743 | 1744 | Local<Object> exports = Object::New(env->isolate()); | |
| 1744 | - Local<String> exports_prop = String::NewFromUtf8(env->isolate(), "exports"); | ||
| 1745 | + Local<String> exports_prop = String::NewFromUtf8(env->isolate(), "exports", | ||
| 1746 | + v8::NewStringType::kNormal).ToLocalChecked(); | ||
| 1745 | 1747 | module->Set(exports_prop, exports); | |
| 1746 | 1748 | ||
| 1747 | 1749 | if (mod->nm_context_register_func != nullptr) { | |
@@ -1764,7 +1766,8 @@ static void ProcessTitleGetter(Local<Name> property, | |||
| 1764 | 1766 | const PropertyCallbackInfo<Value>& info) { | |
| 1765 | 1767 | char buffer[512]; | |
| 1766 | 1768 | uv_get_process_title(buffer, sizeof(buffer)); | |
| 1767 | - info.GetReturnValue().Set(String::NewFromUtf8(info.GetIsolate(), buffer)); | ||
| 1769 | + info.GetReturnValue().Set(String::NewFromUtf8(info.GetIsolate(), buffer, | ||
| 1770 | + v8::NewStringType::kNormal).ToLocalChecked()); | ||
| 1768 | 1771 | } | |
| 1769 | 1772 | ||
| 1770 | 1773 | ||
@@ -1789,7 +1792,8 @@ static void EnvGetter(Local<Name> property, | |||
| 1789 | 1792 | node::Utf8Value key(isolate, property); | |
| 1790 | 1793 | const char* val = getenv(*key); | |
| 1791 | 1794 | if (val) { | |
| 1792 | - return info.GetReturnValue().Set(String::NewFromUtf8(isolate, val)); | ||
| 1795 | + return info.GetReturnValue().Set(String::NewFromUtf8(isolate, val, | ||
| 1796 | + v8::NewStringType::kNormal).ToLocalChecked()); | ||
| 1793 | 1797 | } | |
| 1794 | 1798 | #else // _WIN32 | |
| 1795 | 1799 | node::TwoByteValue key(isolate, property); | |
@@ -1917,8 +1921,8 @@ static void EnvEnumerator(const PropertyCallbackInfo<Array>& info) { | |||
| 1917 | 1921 | const int length = s ? s - var : strlen(var); | |
| 1918 | 1922 | argv[idx] = String::NewFromUtf8(isolate, | |
| 1919 | 1923 | var, | |
| 1920 | - String::kNormalString, | ||
| 1921 | - length); | ||
| 1924 | + v8::NewStringType::kNormal, | ||
| 1925 | + length).ToLocalChecked(); | ||
| 1922 | 1926 | if (++idx >= arraysize(argv)) { | |
| 1923 | 1927 | fn->Call(ctx, envarr, idx, argv).ToLocalChecked(); | |
| 1924 | 1928 | idx = 0; | |
@@ -2195,14 +2199,16 @@ void SetupProcessObject(Environment* env, | |||
| 2195 | 2199 | // process.argv | |
| 2196 | 2200 | Local<Array> arguments = Array::New(env->isolate(), argc); | |
| 2197 | 2201 | for (int i = 0; i < argc; ++i) { | |
| 2198 | - arguments->Set(i, String::NewFromUtf8(env->isolate(), argv[i])); | ||
| 2202 | + arguments->Set(i, String::NewFromUtf8(env->isolate(), argv[i], | ||
| 2203 | + v8::NewStringType::kNormal).ToLocalChecked()); | ||
| 2199 | 2204 | } | |
| 2200 | 2205 | process->Set(FIXED_ONE_BYTE_STRING(env->isolate(), "argv"), arguments); | |
| 2201 | 2206 | ||
| 2202 | 2207 | // process.execArgv | |
| 2203 | 2208 | Local<Array> exec_arguments = Array::New(env->isolate(), exec_argc); | |
| 2204 | 2209 | for (int i = 0; i < exec_argc; ++i) { | |
| 2205 | - exec_arguments->Set(i, String::NewFromUtf8(env->isolate(), exec_argv[i])); | ||
| 2210 | + exec_arguments->Set(i, String::NewFromUtf8(env->isolate(), exec_argv[i], | ||
| 2211 | + v8::NewStringType::kNormal).ToLocalChecked()); | ||
| 2206 | 2212 | } | |
| 2207 | 2213 | process->Set(FIXED_ONE_BYTE_STRING(env->isolate(), "execArgv"), | |
| 2208 | 2214 | exec_arguments); | |
@@ -2234,7 +2240,8 @@ void SetupProcessObject(Environment* env, | |||
| 2234 | 2240 | if (eval_string) { | |
| 2235 | 2241 | READONLY_PROPERTY(process, | |
| 2236 | 2242 | "_eval", | |
| 2237 | - String::NewFromUtf8(env->isolate(), eval_string)); | ||
| 2243 | + String::NewFromUtf8(env->isolate(), eval_string, | ||
| 2244 | + v8::NewStringType::kNormal).ToLocalChecked()); | ||
| 2238 | 2245 | } | |
| 2239 | 2246 | ||
| 2240 | 2247 | // -p, --print | |
@@ -2257,7 +2264,9 @@ void SetupProcessObject(Environment* env, | |||
| 2257 | 2264 | Local<Array> array = Array::New(env->isolate()); | |
| 2258 | 2265 | for (unsigned int i = 0; i < preload_modules.size(); ++i) { | |
| 2259 | 2266 | Local<String> module = String::NewFromUtf8(env->isolate(), | |
| 2260 | - preload_modules[i].c_str()); | ||
| 2267 | + preload_modules[i].c_str(), | ||
| 2268 | + v8::NewStringType::kNormal) | ||
| 2269 | + .ToLocalChecked(); | ||
| 2261 | 2270 | array->Set(i, module); | |
| 2262 | 2271 | } | |
| 2263 | 2272 | READONLY_PROPERTY(process, | |
@@ -2342,10 +2351,11 @@ void SetupProcessObject(Environment* env, | |||
| 2342 | 2351 | if (uv_exepath(exec_path, &exec_path_len) == 0) { | |
| 2343 | 2352 | exec_path_value = String::NewFromUtf8(env->isolate(), | |
| 2344 | 2353 | exec_path, | |
| 2345 | - String::kNormalString, | ||
| 2346 | - exec_path_len); | ||
| 2354 | + v8::NewStringType::kNormal, | ||
| 2355 | + exec_path_len).ToLocalChecked(); | ||
| 2347 | 2356 | } else { | |
| 2348 | - exec_path_value = String::NewFromUtf8(env->isolate(), argv[0]); | ||
| 2357 | + exec_path_value = String::NewFromUtf8(env->isolate(), argv[0], | ||
| 2358 | + v8::NewStringType::kNormal).ToLocalChecked(); | ||
| 2349 | 2359 | } | |
| 2350 | 2360 | process->Set(FIXED_ONE_BYTE_STRING(env->isolate(), "execPath"), | |
| 2351 | 2361 | exec_path_value); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -303,7 +303,8 @@ NODE_EXTERN struct uv_loop_s* GetCurrentEventLoop(v8::Isolate* isolate); | |||
| 303 | 303 | v8::Isolate* isolate = target->GetIsolate(); \ | |
| 304 | 304 | v8::Local<v8::Context> context = isolate->GetCurrentContext(); \ | |
| 305 | 305 | v8::Local<v8::String> constant_name = \ | |
| 306 | - v8::String::NewFromUtf8(isolate, #constant); \ | ||
| 306 | + v8::String::NewFromUtf8(isolate, #constant, \ | ||
| 307 | + v8::NewStringType::kNormal).ToLocalChecked(); \ | ||
| 307 | 308 | v8::Local<v8::Number> constant_value = \ | |
| 308 | 309 | v8::Number::New(isolate, static_cast<double>(constant)); \ | |
| 309 | 310 | v8::PropertyAttribute constant_attributes = \ | |
@@ -344,7 +345,8 @@ inline void NODE_SET_METHOD(v8::Local<v8::Template> recv, | |||
| 344 | 345 | v8::HandleScope handle_scope(isolate); | |
| 345 | 346 | v8::Local<v8::FunctionTemplate> t = v8::FunctionTemplate::New(isolate, | |
| 346 | 347 | callback); | |
| 347 | - v8::Local<v8::String> fn_name = v8::String::NewFromUtf8(isolate, name); | ||
| 348 | + v8::Local<v8::String> fn_name = v8::String::NewFromUtf8(isolate, name, | ||
| 349 | + v8::NewStringType::kNormal).ToLocalChecked(); | ||
| 348 | 350 | t->SetClassName(fn_name); | |
| 349 | 351 | recv->Set(fn_name, t); | |
| 350 | 352 | } | |
@@ -358,7 +360,8 @@ inline void NODE_SET_METHOD(v8::Local<v8::Object> recv, | |||
| 358 | 360 | v8::Local<v8::FunctionTemplate> t = v8::FunctionTemplate::New(isolate, | |
| 359 | 361 | callback); | |
| 360 | 362 | v8::Local<v8::Function> fn = t->GetFunction(); | |
| 361 | - v8::Local<v8::String> fn_name = v8::String::NewFromUtf8(isolate, name); | ||
| 363 | + v8::Local<v8::String> fn_name = v8::String::NewFromUtf8(isolate, name, | ||
| 364 | + v8::NewStringType::kNormal).ToLocalChecked(); | ||
| 362 | 365 | fn->SetName(fn_name); | |
| 363 | 366 | recv->Set(fn_name, fn); | |
| 364 | 367 | } | |
@@ -374,7 +377,8 @@ inline void NODE_SET_PROTOTYPE_METHOD(v8::Local<v8::FunctionTemplate> recv, | |||
| 374 | 377 | v8::Local<v8::Signature> s = v8::Signature::New(isolate, recv); | |
| 375 | 378 | v8::Local<v8::FunctionTemplate> t = | |
| 376 | 379 | v8::FunctionTemplate::New(isolate, callback, v8::Local<v8::Value>(), s); | |
| 377 | - v8::Local<v8::String> fn_name = v8::String::NewFromUtf8(isolate, name); | ||
| 380 | + v8::Local<v8::String> fn_name = v8::String::NewFromUtf8(isolate, name, | ||
| 381 | + v8::NewStringType::kNormal).ToLocalChecked(); | ||
| 378 | 382 | t->SetClassName(fn_name); | |
| 379 | 383 | recv->PrototypeTemplate()->Set(fn_name, t); | |
| 380 | 384 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1563,8 +1563,8 @@ static Local<Object> X509ToObject(Environment* env, X509* cert) { | |||
| 1563 | 1563 | BIO_get_mem_ptr(bio.get(), &mem); | |
| 1564 | 1564 | info->Set(context, env->subject_string(), | |
| 1565 | 1565 | String::NewFromUtf8(env->isolate(), mem->data, | |
| 1566 | - String::kNormalString, | ||
| 1567 | - mem->length)).FromJust(); | ||
| 1566 | + NewStringType::kNormal, | ||
| 1567 | + mem->length).ToLocalChecked()).FromJust(); | ||
| 1568 | 1568 | } | |
| 1569 | 1569 | USE(BIO_reset(bio.get())); | |
| 1570 | 1570 | ||
@@ -1573,8 +1573,8 @@ static Local<Object> X509ToObject(Environment* env, X509* cert) { | |||
| 1573 | 1573 | BIO_get_mem_ptr(bio.get(), &mem); | |
| 1574 | 1574 | info->Set(context, env->issuer_string(), | |
| 1575 | 1575 | String::NewFromUtf8(env->isolate(), mem->data, | |
| 1576 | - String::kNormalString, | ||
| 1577 | - mem->length)).FromJust(); | ||
| 1576 | + NewStringType::kNormal, | ||
| 1577 | + mem->length).ToLocalChecked()).FromJust(); | ||
| 1578 | 1578 | } | |
| 1579 | 1579 | USE(BIO_reset(bio.get())); | |
| 1580 | 1580 | ||
@@ -1601,8 +1601,8 @@ static Local<Object> X509ToObject(Environment* env, X509* cert) { | |||
| 1601 | 1601 | BIO_get_mem_ptr(bio.get(), &mem); | |
| 1602 | 1602 | info->Set(context, keys[i], | |
| 1603 | 1603 | String::NewFromUtf8(env->isolate(), mem->data, | |
| 1604 | - String::kNormalString, | ||
| 1605 | - mem->length)).FromJust(); | ||
| 1604 | + NewStringType::kNormal, | ||
| 1605 | + mem->length).ToLocalChecked()).FromJust(); | ||
| 1606 | 1606 | ||
| 1607 | 1607 | USE(BIO_reset(bio.get())); | |
| 1608 | 1608 | } | |
@@ -1620,8 +1620,8 @@ static Local<Object> X509ToObject(Environment* env, X509* cert) { | |||
| 1620 | 1620 | BIO_get_mem_ptr(bio.get(), &mem); | |
| 1621 | 1621 | info->Set(context, env->modulus_string(), | |
| 1622 | 1622 | String::NewFromUtf8(env->isolate(), mem->data, | |
| 1623 | - String::kNormalString, | ||
| 1624 | - mem->length)).FromJust(); | ||
| 1623 | + NewStringType::kNormal, | ||
| 1624 | + mem->length).ToLocalChecked()).FromJust(); | ||
| 1625 | 1625 | USE(BIO_reset(bio.get())); | |
| 1626 | 1626 | ||
| 1627 | 1627 | uint64_t exponent_word = static_cast<uint64_t>(BN_get_word(e)); | |
@@ -1635,8 +1635,8 @@ static Local<Object> X509ToObject(Environment* env, X509* cert) { | |||
| 1635 | 1635 | BIO_get_mem_ptr(bio.get(), &mem); | |
| 1636 | 1636 | info->Set(context, env->exponent_string(), | |
| 1637 | 1637 | String::NewFromUtf8(env->isolate(), mem->data, | |
| 1638 | - String::kNormalString, | ||
| 1639 | - mem->length)).FromJust(); | ||
| 1638 | + NewStringType::kNormal, | ||
| 1639 | + mem->length).ToLocalChecked()).FromJust(); | ||
| 1640 | 1640 | USE(BIO_reset(bio.get())); | |
| 1641 | 1641 | ||
| 1642 | 1642 | int size = i2d_RSA_PUBKEY(rsa.get(), nullptr); | |
@@ -1655,16 +1655,16 @@ static Local<Object> X509ToObject(Environment* env, X509* cert) { | |||
| 1655 | 1655 | BIO_get_mem_ptr(bio.get(), &mem); | |
| 1656 | 1656 | info->Set(context, env->valid_from_string(), | |
| 1657 | 1657 | String::NewFromUtf8(env->isolate(), mem->data, | |
| 1658 | - String::kNormalString, | ||
| 1659 | - mem->length)).FromJust(); | ||
| 1658 | + NewStringType::kNormal, | ||
| 1659 | + mem->length).ToLocalChecked()).FromJust(); | ||
| 1660 | 1660 | USE(BIO_reset(bio.get())); | |
| 1661 | 1661 | ||
| 1662 | 1662 | ASN1_TIME_print(bio.get(), X509_get_notAfter(cert)); | |
| 1663 | 1663 | BIO_get_mem_ptr(bio.get(), &mem); | |
| 1664 | 1664 | info->Set(context, env->valid_to_string(), | |
| 1665 | 1665 | String::NewFromUtf8(env->isolate(), mem->data, | |
| 1666 | - String::kNormalString, | ||
| 1667 | - mem->length)).FromJust(); | ||
| 1666 | + NewStringType::kNormal, | ||
| 1667 | + mem->length).ToLocalChecked()).FromJust(); | ||
| 1668 | 1668 | bio.reset(); | |
| 1669 | 1669 | ||
| 1670 | 1670 | unsigned char md[EVP_MAX_MD_SIZE]; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -794,8 +794,8 @@ static void InternalModuleReadJSON(const FunctionCallbackInfo<Value>& args) { | |||
| 794 | 794 | Local<String> chars_string = | |
| 795 | 795 | String::NewFromUtf8(env->isolate(), | |
| 796 | 796 | &chars[start], | |
| 797 | - String::kNormalString, | ||
| 798 | - size); | ||
| 797 | + v8::NewStringType::kNormal, | ||
| 798 | + size).ToLocalChecked(); | ||
| 799 | 799 | args.GetReturnValue().Set(chars_string); | |
| 800 | 800 | } | |
| 801 | 801 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -552,7 +552,7 @@ void GetVersion(const FunctionCallbackInfo<Value>& args) { | |||
| 552 | 552 | TYPE_ICU "," | |
| 553 | 553 | TYPE_UNICODE "," | |
| 554 | 554 | TYPE_CLDR "," | |
| 555 | - TYPE_TZ)); | ||
| 555 | + TYPE_TZ, v8::NewStringType::kNormal).ToLocalChecked()); | ||
| 556 | 556 | } else { | |
| 557 | 557 | CHECK_GE(args.Length(), 1); | |
| 558 | 558 | CHECK(args[0]->IsString()); | |
@@ -565,7 +565,7 @@ void GetVersion(const FunctionCallbackInfo<Value>& args) { | |||
| 565 | 565 | // Success. | |
| 566 | 566 | args.GetReturnValue().Set( | |
| 567 | 567 | String::NewFromUtf8(env->isolate(), | |
| 568 | - versionString)); | ||
| 568 | + versionString, v8::NewStringType::kNormal).ToLocalChecked()); | ||
| 569 | 569 | } | |
| 570 | 570 | } | |
| 571 | 571 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -72,9 +72,11 @@ struct sockaddr; | |||
| 72 | 72 | do { \ | |
| 73 | 73 | v8::Isolate* isolate = target->GetIsolate(); \ | |
| 74 | 74 | v8::Local<v8::String> constant_name = \ | |
| 75 | - v8::String::NewFromUtf8(isolate, name); \ | ||
| 75 | + v8::String::NewFromUtf8(isolate, name, v8::NewStringType::kNormal) \ | ||
| 76 | + .ToLocalChecked(); \ | ||
| 76 | 77 | v8::Local<v8::String> constant_value = \ | |
| 77 | - v8::String::NewFromUtf8(isolate, constant); \ | ||
| 78 | + v8::String::NewFromUtf8(isolate, constant, v8::NewStringType::kNormal)\ | ||
| 79 | + .ToLocalChecked(); \ | ||
| 78 | 80 | v8::PropertyAttribute constant_attributes = \ | |
| 79 | 81 | static_cast<v8::PropertyAttribute>(v8::ReadOnly | v8::DontDelete); \ | |
| 80 | 82 | target->DefineOwnProperty(isolate->GetCurrentContext(), \ | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -261,7 +261,8 @@ static void GetInterfaceAddresses(const FunctionCallbackInfo<Value>& args) { | |||
| 261 | 261 | // contain non-ASCII characters. On UNIX, it's just a binary string with | |
| 262 | 262 | // no particular encoding but we treat it as a one-byte Latin-1 string. | |
| 263 | 263 | #ifdef _WIN32 | |
| 264 | - name = String::NewFromUtf8(env->isolate(), raw_name); | ||
| 264 | + name = String::NewFromUtf8(env->isolate(), raw_name, | ||
| 265 | + v8::NewStringType::kNormal).ToLocalChecked(); | ||
| 265 | 266 | #else | |
| 266 | 267 | name = OneByteString(env->isolate(), raw_name); | |
| 267 | 268 | #endif | |
@@ -335,8 +336,8 @@ static void GetHomeDirectory(const FunctionCallbackInfo<Value>& args) { | |||
| 335 | 336 | ||
| 336 | 337 | Local<String> home = String::NewFromUtf8(env->isolate(), | |
| 337 | 338 | buf, | |
| 338 | - String::kNormalString, | ||
| 339 | - len); | ||
| 339 | + v8::NewStringType::kNormal, | ||
| 340 | + len).ToLocalChecked(); | ||
| 340 | 341 | args.GetReturnValue().Set(home); | |
| 341 | 342 | } | |
| 342 | 343 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -75,14 +75,18 @@ inline void InitObject(const PerformanceEntry& entry, Local<Object> obj) { | |||
| 75 | 75 | env->name_string(), | |
| 76 | 76 | String::NewFromUtf8(isolate, | |
| 77 | 77 | entry.name().c_str(), | |
| 78 | - String::kNormalString), | ||
| 79 | - attr).FromJust(); | ||
| 78 | + v8::NewStringType::kNormal) | ||
| 79 | + .ToLocalChecked(), | ||
| 80 | + attr) | ||
| 81 | + .FromJust(); | ||
| 80 | 82 | obj->DefineOwnProperty(context, | |
| 81 | 83 | FIXED_ONE_BYTE_STRING(isolate, "entryType"), | |
| 82 | 84 | String::NewFromUtf8(isolate, | |
| 83 | 85 | entry.type().c_str(), | |
| 84 | - String::kNormalString), | ||
| 85 | - attr).FromJust(); | ||
| 86 | + v8::NewStringType::kNormal) | ||
| 87 | + .ToLocalChecked(), | ||
| 88 | + attr) | ||
| 89 | + .FromJust(); | ||
| 86 | 90 | obj->DefineOwnProperty(context, | |
| 87 | 91 | FIXED_ONE_BYTE_STRING(isolate, "startTime"), | |
| 88 | 92 | Number::New(isolate, entry.startTime()), | |
| Back | FazBrowse Home | New Git URL |
0 commit comments