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

Side by Side Diff: src/objects.cc

Issue 2554943002: Reland Create JSPromise (patchset #16 id:300001 of https://codereview.chromium.org/2536463002/ )" (Closed)
Patch Set: fix test 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 16429 matching lines...) Expand 10 before | Expand all | Expand 10 after
16440 return array; 16440 return array;
16441 } 16441 }
16442 16442
16443 private: 16443 private:
16444 Handle<String> source_; 16444 Handle<String> source_;
16445 Handle<SharedFunctionInfo> shared_; 16445 Handle<SharedFunctionInfo> shared_;
16446 LanguageMode language_mode_; 16446 LanguageMode language_mode_;
16447 int scope_position_; 16447 int scope_position_;
16448 }; 16448 };
16449 16449
16450 // static
16451 const char* JSPromise::Status(int status) {
16452 switch (status) {
16453 case kPromiseFulfilled:
16454 return "resolved";
16455 case kPromisePending:
16456 return "pending";
16457 case kPromiseRejected:
16458 return "rejected";
16459 }
16460 UNREACHABLE();
16461 return NULL;
16462 }
16450 16463
16451 namespace { 16464 namespace {
16452 16465
16453 JSRegExp::Flags RegExpFlagsFromString(Handle<String> flags, bool* success) { 16466 JSRegExp::Flags RegExpFlagsFromString(Handle<String> flags, bool* success) {
16454 JSRegExp::Flags value = JSRegExp::kNone; 16467 JSRegExp::Flags value = JSRegExp::kNone;
16455 int length = flags->length(); 16468 int length = flags->length();
16456 // A longer flags string cannot be valid. 16469 // A longer flags string cannot be valid.
16457 if (length > 5) return JSRegExp::Flags(0); 16470 if (length > 5) return JSRegExp::Flags(0);
16458 for (int i = 0; i < length; i++) { 16471 for (int i = 0; i < length; i++) {
16459 JSRegExp::Flag flag = JSRegExp::kNone; 16472 JSRegExp::Flag flag = JSRegExp::kNone;
(...skipping 3933 matching lines...) Expand 10 before | Expand all | Expand 10 after
20393 // depend on this. 20406 // depend on this.
20394 return DICTIONARY_ELEMENTS; 20407 return DICTIONARY_ELEMENTS;
20395 } 20408 }
20396 DCHECK_LE(kind, LAST_ELEMENTS_KIND); 20409 DCHECK_LE(kind, LAST_ELEMENTS_KIND);
20397 return kind; 20410 return kind;
20398 } 20411 }
20399 } 20412 }
20400 20413
20401 } // namespace internal 20414 } // namespace internal
20402 } // namespace v8 20415 } // 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