OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 3662 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3673 return ReportUnexpectedToken(); | 3673 return ReportUnexpectedToken(); |
3674 } | 3674 } |
3675 Handle<String> key = GetString(); | 3675 Handle<String> key = GetString(); |
3676 if (scanner_.Next() != Token::COLON) { | 3676 if (scanner_.Next() != Token::COLON) { |
3677 return ReportUnexpectedToken(); | 3677 return ReportUnexpectedToken(); |
3678 } | 3678 } |
3679 Handle<Object> value = ParseJsonValue(); | 3679 Handle<Object> value = ParseJsonValue(); |
3680 if (value.is_null()) return Handle<Object>::null(); | 3680 if (value.is_null()) return Handle<Object>::null(); |
3681 uint32_t index; | 3681 uint32_t index; |
3682 if (key->AsArrayIndex(&index)) { | 3682 if (key->AsArrayIndex(&index)) { |
3683 SetElement(json_object, index, value); | 3683 CALL_HEAP_FUNCTION_INLINE( |
| 3684 (*json_object)->SetElement(index, *value, true)); |
3684 } else { | 3685 } else { |
3685 SetProperty(json_object, key, value, NONE); | 3686 CALL_HEAP_FUNCTION_INLINE( |
| 3687 (*json_object)->SetPropertyPostInterceptor(*key, *value, NONE)); |
3686 } | 3688 } |
3687 } while (scanner_.Next() == Token::COMMA); | 3689 } while (scanner_.Next() == Token::COMMA); |
3688 if (scanner_.current_token() != Token::RBRACE) { | 3690 if (scanner_.current_token() != Token::RBRACE) { |
3689 return ReportUnexpectedToken(); | 3691 return ReportUnexpectedToken(); |
3690 } | 3692 } |
3691 } | 3693 } |
3692 return json_object; | 3694 return json_object; |
3693 } | 3695 } |
3694 | 3696 |
3695 | 3697 |
(...skipping 1010 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4706 Handle<String> source = Handle<String>(String::cast(script->source())); | 4708 Handle<String> source = Handle<String>(String::cast(script->source())); |
4707 result = parser.ParseProgram(source, info->is_global()); | 4709 result = parser.ParseProgram(source, info->is_global()); |
4708 } | 4710 } |
4709 } | 4711 } |
4710 | 4712 |
4711 info->SetFunction(result); | 4713 info->SetFunction(result); |
4712 return (result != NULL); | 4714 return (result != NULL); |
4713 } | 4715 } |
4714 | 4716 |
4715 } } // namespace v8::internal | 4717 } } // namespace v8::internal |
OLD | NEW |