OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
593 Handle<Object> value(value_raw, isolate); | 593 Handle<Object> value(value_raw, isolate); |
594 if (!function->should_have_prototype()) { | 594 if (!function->should_have_prototype()) { |
595 // Since we hit this accessor, object will have no prototype property. | 595 // Since we hit this accessor, object will have no prototype property. |
596 Handle<Object> result = JSObject::SetLocalPropertyIgnoreAttributes(object, | 596 Handle<Object> result = JSObject::SetLocalPropertyIgnoreAttributes(object, |
597 isolate->factory()->prototype_string(), value, NONE); | 597 isolate->factory()->prototype_string(), value, NONE); |
598 RETURN_IF_EMPTY_HANDLE(isolate, result); | 598 RETURN_IF_EMPTY_HANDLE(isolate, result); |
599 return *result; | 599 return *result; |
600 } | 600 } |
601 | 601 |
602 Handle<Object> old_value; | 602 Handle<Object> old_value; |
603 bool is_observed = *function == *object && function->map()->is_observed(); | 603 bool is_observed = |
| 604 FLAG_harmony_observation && |
| 605 *function == *object && |
| 606 function->map()->is_observed(); |
604 if (is_observed) { | 607 if (is_observed) { |
605 if (function->has_prototype()) | 608 if (function->has_prototype()) |
606 old_value = handle(function->prototype(), isolate); | 609 old_value = handle(function->prototype(), isolate); |
607 else | 610 else |
608 old_value = isolate->factory()->NewFunctionPrototype(function); | 611 old_value = isolate->factory()->NewFunctionPrototype(function); |
609 } | 612 } |
610 | 613 |
611 JSFunction::SetPrototype(function, value); | 614 JSFunction::SetPrototype(function, value); |
612 ASSERT(function->prototype() == *value); | 615 ASSERT(function->prototype() == *value); |
613 | 616 |
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
965 info->set_data(Smi::FromInt(index)); | 968 info->set_data(Smi::FromInt(index)); |
966 Handle<Object> getter = v8::FromCData(isolate, &ModuleGetExport); | 969 Handle<Object> getter = v8::FromCData(isolate, &ModuleGetExport); |
967 Handle<Object> setter = v8::FromCData(isolate, &ModuleSetExport); | 970 Handle<Object> setter = v8::FromCData(isolate, &ModuleSetExport); |
968 info->set_getter(*getter); | 971 info->set_getter(*getter); |
969 if (!(attributes & ReadOnly)) info->set_setter(*setter); | 972 if (!(attributes & ReadOnly)) info->set_setter(*setter); |
970 return info; | 973 return info; |
971 } | 974 } |
972 | 975 |
973 | 976 |
974 } } // namespace v8::internal | 977 } } // namespace v8::internal |
OLD | NEW |