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

Side by Side Diff: src/api-natives.cc

Issue 1126043004: Migrate error messages, part 10. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fixed and rebased 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/api.cc ('k') | src/builtins.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/api-natives.h" 5 #include "src/api-natives.h"
6 6
7 #include "src/api.h" 7 #include "src/api.h"
8 #include "src/isolate.h" 8 #include "src/isolate.h"
9 #include "src/lookup.h" 9 #include "src/lookup.h"
10 #include "src/messages.h"
10 11
11 namespace v8 { 12 namespace v8 {
12 namespace internal { 13 namespace internal {
13 14
14 15
15 namespace { 16 namespace {
16 17
17 MaybeHandle<JSObject> InstantiateObject(Isolate* isolate, 18 MaybeHandle<JSObject> InstantiateObject(Isolate* isolate,
18 Handle<ObjectTemplateInfo> data); 19 Handle<ObjectTemplateInfo> data);
19 20
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 DCHECK(maybe.IsJust()); 89 DCHECK(maybe.IsJust());
89 duplicate = it.IsFound(); 90 duplicate = it.IsFound();
90 } else { 91 } else {
91 uint32_t index = 0; 92 uint32_t index = 0;
92 key->ToArrayIndex(&index); 93 key->ToArrayIndex(&index);
93 Maybe<bool> maybe = JSReceiver::HasOwnElement(object, index); 94 Maybe<bool> maybe = JSReceiver::HasOwnElement(object, index);
94 if (!maybe.IsJust()) return MaybeHandle<Object>(); 95 if (!maybe.IsJust()) return MaybeHandle<Object>();
95 duplicate = maybe.FromJust(); 96 duplicate = maybe.FromJust();
96 } 97 }
97 if (duplicate) { 98 if (duplicate) {
98 Handle<Object> args[1] = {key}; 99 THROW_NEW_ERROR(
99 THROW_NEW_ERROR(isolate, NewTypeError("duplicate_template_property", 100 isolate, NewTypeError(MessageTemplate::kDuplicateTemplateProperty, key),
100 HandleVector(args, 1)), 101 Object);
101 Object);
102 } 102 }
103 #endif 103 #endif
104 104
105 RETURN_ON_EXCEPTION( 105 RETURN_ON_EXCEPTION(
106 isolate, Runtime::DefineObjectProperty(object, key, value, attributes), 106 isolate, Runtime::DefineObjectProperty(object, key, value, attributes),
107 Object); 107 Object);
108 return object; 108 return object;
109 } 109 }
110 110
111 111
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after
579 Handle<AccessorInfo> accessor(AccessorInfo::cast(array->get(i))); 579 Handle<AccessorInfo> accessor(AccessorInfo::cast(array->get(i)));
580 JSObject::SetAccessor(result, accessor).Assert(); 580 JSObject::SetAccessor(result, accessor).Assert();
581 } 581 }
582 582
583 DCHECK(result->shared()->IsApiFunction()); 583 DCHECK(result->shared()->IsApiFunction());
584 return result; 584 return result;
585 } 585 }
586 586
587 } // namespace internal 587 } // namespace internal
588 } // namespace v8 588 } // namespace v8
OLDNEW
« no previous file with comments | « src/api.cc ('k') | src/builtins.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698