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

Side by Side Diff: src/json-stringifier.h

Issue 1130073005: Revert of Migrate error messages, part 10. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 7 months 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/json.js ('k') | src/messages.h » ('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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 #ifndef V8_JSON_STRINGIFIER_H_ 5 #ifndef V8_JSON_STRINGIFIER_H_
6 #define V8_JSON_STRINGIFIER_H_ 6 #define V8_JSON_STRINGIFIER_H_
7 7
8 #include "src/v8.h" 8 #include "src/v8.h"
9 9
10 #include "src/conversions.h" 10 #include "src/conversions.h"
11 #include "src/messages.h"
12 #include "src/string-builder.h" 11 #include "src/string-builder.h"
13 #include "src/utils.h" 12 #include "src/utils.h"
14 13
15 namespace v8 { 14 namespace v8 {
16 namespace internal { 15 namespace internal {
17 16
18 class BasicJsonStringifier BASE_EMBEDDED { 17 class BasicJsonStringifier BASE_EMBEDDED {
19 public: 18 public:
20 explicit BasicJsonStringifier(Isolate* isolate); 19 explicit BasicJsonStringifier(Isolate* isolate);
21 20
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 return EXCEPTION; 265 return EXCEPTION;
267 } 266 }
268 267
269 int length = Smi::cast(stack_->length())->value(); 268 int length = Smi::cast(stack_->length())->value();
270 { 269 {
271 DisallowHeapAllocation no_allocation; 270 DisallowHeapAllocation no_allocation;
272 FixedArray* elements = FixedArray::cast(stack_->elements()); 271 FixedArray* elements = FixedArray::cast(stack_->elements());
273 for (int i = 0; i < length; i++) { 272 for (int i = 0; i < length; i++) {
274 if (elements->get(i) == *object) { 273 if (elements->get(i) == *object) {
275 AllowHeapAllocation allow_to_return_error; 274 AllowHeapAllocation allow_to_return_error;
276 Handle<Object> error = 275 Handle<Object> error = factory()->NewTypeError(
277 factory()->NewTypeError(MessageTemplate::kCircularStructure); 276 "circular_structure", HandleVector<Object>(NULL, 0));
278 isolate_->Throw(*error); 277 isolate_->Throw(*error);
279 return EXCEPTION; 278 return EXCEPTION;
280 } 279 }
281 } 280 }
282 } 281 }
283 JSArray::EnsureSize(stack_, length + 1); 282 JSArray::EnsureSize(stack_, length + 1);
284 FixedArray::cast(stack_->elements())->set(length, *object); 283 FixedArray::cast(stack_->elements())->set(length, *object);
285 stack_->set_length(Smi::FromInt(length + 1)); 284 stack_->set_length(Smi::FromInt(length + 1));
286 return SUCCESS; 285 return SUCCESS;
287 } 286 }
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after
681 SerializeString_<uint8_t, uc16>(object); 680 SerializeString_<uint8_t, uc16>(object);
682 } else { 681 } else {
683 SerializeString_<uc16, uc16>(object); 682 SerializeString_<uc16, uc16>(object);
684 } 683 }
685 } 684 }
686 } 685 }
687 686
688 } } // namespace v8::internal 687 } } // namespace v8::internal
689 688
690 #endif // V8_JSON_STRINGIFIER_H_ 689 #endif // V8_JSON_STRINGIFIER_H_
OLDNEW
« no previous file with comments | « src/json.js ('k') | src/messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698