Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(61)

Side by Side Diff: src/objects.cc

Issue 2554013002: Revert of Create JSPromise (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/objects.h ('k') | src/objects-debug.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 }
16575 16562
16576 namespace { 16563 namespace {
16577 16564
16578 JSRegExp::Flags RegExpFlagsFromString(Handle<String> flags, bool* success) { 16565 JSRegExp::Flags RegExpFlagsFromString(Handle<String> flags, bool* success) {
16579 JSRegExp::Flags value = JSRegExp::kNone; 16566 JSRegExp::Flags value = JSRegExp::kNone;
16580 int length = flags->length(); 16567 int length = flags->length();
16581 // A longer flags string cannot be valid. 16568 // A longer flags string cannot be valid.
16582 if (length > 5) return JSRegExp::Flags(0); 16569 if (length > 5) return JSRegExp::Flags(0);
16583 for (int i = 0; i < length; i++) { 16570 for (int i = 0; i < length; i++) {
16584 JSRegExp::Flag flag = JSRegExp::kNone; 16571 JSRegExp::Flag flag = JSRegExp::kNone;
(...skipping 3930 matching lines...) Expand 10 before | Expand all | Expand 10 after
20515 // depend on this. 20502 // depend on this.
20516 return DICTIONARY_ELEMENTS; 20503 return DICTIONARY_ELEMENTS;
20517 } 20504 }
20518 DCHECK_LE(kind, LAST_ELEMENTS_KIND); 20505 DCHECK_LE(kind, LAST_ELEMENTS_KIND);
20519 return kind; 20506 return kind;
20520 } 20507 }
20521 } 20508 }
20522 20509
20523 } // namespace internal 20510 } // namespace internal
20524 } // namespace v8 20511 } // namespace v8
OLDNEW
« no previous file with comments | « src/objects.h ('k') | src/objects-debug.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698