OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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/json-parser.h" | 5 #include "src/json-parser.h" |
6 | 6 |
7 #include "src/char-predicates-inl.h" | 7 #include "src/char-predicates-inl.h" |
8 #include "src/conversions.h" | 8 #include "src/conversions.h" |
9 #include "src/debug/debug.h" | 9 #include "src/debug/debug.h" |
10 #include "src/factory.h" | 10 #include "src/factory.h" |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 Object); | 76 Object); |
77 return outer_scope.CloseAndEscape(result); | 77 return outer_scope.CloseAndEscape(result); |
78 } | 78 } |
79 | 79 |
80 bool JsonParseInternalizer::RecurseAndApply(Handle<JSReceiver> holder, | 80 bool JsonParseInternalizer::RecurseAndApply(Handle<JSReceiver> holder, |
81 Handle<String> name) { | 81 Handle<String> name) { |
82 Handle<Object> result; | 82 Handle<Object> result; |
83 ASSIGN_RETURN_ON_EXCEPTION_VALUE( | 83 ASSIGN_RETURN_ON_EXCEPTION_VALUE( |
84 isolate_, result, InternalizeJsonProperty(holder, name), false); | 84 isolate_, result, InternalizeJsonProperty(holder, name), false); |
85 Maybe<bool> change_result = Nothing<bool>(); | 85 Maybe<bool> change_result = Nothing<bool>(); |
86 if (result->IsUndefined()) { | 86 if (result->IsUndefined(isolate_)) { |
87 change_result = JSReceiver::DeletePropertyOrElement(holder, name, SLOPPY); | 87 change_result = JSReceiver::DeletePropertyOrElement(holder, name, SLOPPY); |
88 } else { | 88 } else { |
89 PropertyDescriptor desc; | 89 PropertyDescriptor desc; |
90 desc.set_value(result); | 90 desc.set_value(result); |
91 desc.set_configurable(true); | 91 desc.set_configurable(true); |
92 desc.set_enumerable(true); | 92 desc.set_enumerable(true); |
93 desc.set_writable(true); | 93 desc.set_writable(true); |
94 change_result = JSReceiver::DefineOwnProperty(isolate_, holder, name, &desc, | 94 change_result = JSReceiver::DefineOwnProperty(isolate_, holder, name, &desc, |
95 Object::DONT_THROW); | 95 Object::DONT_THROW); |
96 } | 96 } |
(...skipping 707 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
804 AdvanceSkipWhitespace(); | 804 AdvanceSkipWhitespace(); |
805 return result; | 805 return result; |
806 } | 806 } |
807 | 807 |
808 // Explicit instantiation. | 808 // Explicit instantiation. |
809 template class JsonParser<true>; | 809 template class JsonParser<true>; |
810 template class JsonParser<false>; | 810 template class JsonParser<false>; |
811 | 811 |
812 } // namespace internal | 812 } // namespace internal |
813 } // namespace v8 | 813 } // namespace v8 |
OLD | NEW |