| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 1ec09b0 commit e2dec98
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -11,7 +11,7 @@ | |||
| 11 | 11 | #define V8_MAJOR_VERSION 4 | |
| 12 | 12 | #define V8_MINOR_VERSION 7 | |
| 13 | 13 | #define V8_BUILD_NUMBER 80 | |
| 14 | - #define V8_PATCH_LEVEL 24 | ||
| 14 | + #define V8_PATCH_LEVEL 25 | ||
| 15 | 15 | ||
| 16 | 16 | // Use 1 for candidates and 0 otherwise. | |
| 17 | 17 | // (Boolean macro values are not supported by all preprocessors.) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -29,6 +29,7 @@ | |||
| 29 | 29 | ||
| 30 | 30 | #include "src/api.h" | |
| 31 | 31 | #include "src/objects.h" | |
| 32 | + #include "src/utils.h" | ||
| 32 | 33 | ||
| 33 | 34 | namespace v8 { | |
| 34 | 35 | namespace internal { | |
@@ -379,11 +380,32 @@ AstRawString* AstValueFactory::GetString(uint32_t hash, bool is_one_byte, | |||
| 379 | 380 | bool AstValueFactory::AstRawStringCompare(void* a, void* b) { | |
| 380 | 381 | const AstRawString* lhs = static_cast<AstRawString*>(a); | |
| 381 | 382 | const AstRawString* rhs = static_cast<AstRawString*>(b); | |
| 382 | - if (lhs->is_one_byte() != rhs->is_one_byte()) return false; | ||
| 383 | + if (lhs->length() != rhs->length()) return false; | ||
| 383 | 384 | if (lhs->hash() != rhs->hash()) return false; | |
| 384 | - int len = lhs->byte_length(); | ||
| 385 | - if (rhs->byte_length() != len) return false; | ||
| 386 | - return memcmp(lhs->raw_data(), rhs->raw_data(), len) == 0; | ||
| 385 | + const unsigned char* l = lhs->raw_data(); | ||
| 386 | + const unsigned char* r = rhs->raw_data(); | ||
| 387 | + size_t length = rhs->length(); | ||
| 388 | + if (lhs->is_one_byte()) { | ||
| 389 | + if (rhs->is_one_byte()) { | ||
| 390 | + return CompareCharsUnsigned(reinterpret_cast<const uint8_t*>(l), | ||
| 391 | + reinterpret_cast<const uint8_t*>(r), | ||
| 392 | + length) == 0; | ||
| 393 | + } else { | ||
| 394 | + return CompareCharsUnsigned(reinterpret_cast<const uint8_t*>(l), | ||
| 395 | + reinterpret_cast<const uint16_t*>(r), | ||
| 396 | + length) == 0; | ||
| 397 | + } | ||
| 398 | + } else { | ||
| 399 | + if (rhs->is_one_byte()) { | ||
| 400 | + return CompareCharsUnsigned(reinterpret_cast<const uint16_t*>(l), | ||
| 401 | + reinterpret_cast<const uint8_t*>(r), | ||
| 402 | + length) == 0; | ||
| 403 | + } else { | ||
| 404 | + return CompareCharsUnsigned(reinterpret_cast<const uint16_t*>(l), | ||
| 405 | + reinterpret_cast<const uint16_t*>(r), | ||
| 406 | + length) == 0; | ||
| 407 | + } | ||
| 408 | + } | ||
| 387 | 409 | } | |
| 388 | 410 | } // namespace internal | |
| 389 | 411 | } // namespace v8 | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,8 @@ | |||
| 1 | + // Copyright 2015 the V8 project authors. All rights reserved. | ||
| 2 | + // Use of this source code is governed by a BSD-style license that can be | ||
| 3 | + // found in the LICENSE file. | ||
| 4 | + | ||
| 5 | + ({})['foobar\u2653'.slice(0, 6)] = null; | ||
| 6 | + var x; | ||
| 7 | + eval('x = function foobar() { return foobar };'); | ||
| 8 | + x(); | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments