OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/objects.h" | 5 #include "src/objects.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 #include <iomanip> | 8 #include <iomanip> |
9 #include <memory> | 9 #include <memory> |
10 #include <sstream> | 10 #include <sstream> |
(...skipping 16541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
16552 return array; | 16552 return array; |
16553 } | 16553 } |
16554 | 16554 |
16555 private: | 16555 private: |
16556 Handle<String> source_; | 16556 Handle<String> source_; |
16557 Handle<SharedFunctionInfo> shared_; | 16557 Handle<SharedFunctionInfo> shared_; |
16558 LanguageMode language_mode_; | 16558 LanguageMode language_mode_; |
16559 int scope_position_; | 16559 int scope_position_; |
16560 }; | 16560 }; |
16561 | 16561 |
| 16562 // static |
| 16563 const char* JSPromise::Status(int status) { |
| 16564 switch (status) { |
| 16565 case kPromiseFulfilled: |
| 16566 return "resolved"; |
| 16567 case kPromisePending: |
| 16568 return "pending"; |
| 16569 case kPromiseRejected: |
| 16570 return "rejected"; |
| 16571 } |
| 16572 UNREACHABLE(); |
| 16573 return NULL; |
| 16574 } |
16562 | 16575 |
16563 namespace { | 16576 namespace { |
16564 | 16577 |
16565 JSRegExp::Flags RegExpFlagsFromString(Handle<String> flags, bool* success) { | 16578 JSRegExp::Flags RegExpFlagsFromString(Handle<String> flags, bool* success) { |
16566 JSRegExp::Flags value = JSRegExp::kNone; | 16579 JSRegExp::Flags value = JSRegExp::kNone; |
16567 int length = flags->length(); | 16580 int length = flags->length(); |
16568 // A longer flags string cannot be valid. | 16581 // A longer flags string cannot be valid. |
16569 if (length > 5) return JSRegExp::Flags(0); | 16582 if (length > 5) return JSRegExp::Flags(0); |
16570 for (int i = 0; i < length; i++) { | 16583 for (int i = 0; i < length; i++) { |
16571 JSRegExp::Flag flag = JSRegExp::kNone; | 16584 JSRegExp::Flag flag = JSRegExp::kNone; |
(...skipping 3930 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
20502 // depend on this. | 20515 // depend on this. |
20503 return DICTIONARY_ELEMENTS; | 20516 return DICTIONARY_ELEMENTS; |
20504 } | 20517 } |
20505 DCHECK_LE(kind, LAST_ELEMENTS_KIND); | 20518 DCHECK_LE(kind, LAST_ELEMENTS_KIND); |
20506 return kind; | 20519 return kind; |
20507 } | 20520 } |
20508 } | 20521 } |
20509 | 20522 |
20510 } // namespace internal | 20523 } // namespace internal |
20511 } // namespace v8 | 20524 } // namespace v8 |
OLD | NEW |