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

Side by Side Diff: src/accessors.cc

Issue 198383002: Reland "Enable Object.observe by default" again (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | src/bootstrapper.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 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
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 = 603 bool is_observed = *function == *object && function->map()->is_observed();
604 FLAG_harmony_observation &&
605 *function == *object &&
606 function->map()->is_observed();
607 if (is_observed) { 604 if (is_observed) {
608 if (function->has_prototype()) 605 if (function->has_prototype())
609 old_value = handle(function->prototype(), isolate); 606 old_value = handle(function->prototype(), isolate);
610 else 607 else
611 old_value = isolate->factory()->NewFunctionPrototype(function); 608 old_value = isolate->factory()->NewFunctionPrototype(function);
612 } 609 }
613 610
614 JSFunction::SetPrototype(function, value); 611 JSFunction::SetPrototype(function, value);
615 ASSERT(function->prototype() == *value); 612 ASSERT(function->prototype() == *value);
616 613
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after
968 info->set_data(Smi::FromInt(index)); 965 info->set_data(Smi::FromInt(index));
969 Handle<Object> getter = v8::FromCData(isolate, &ModuleGetExport); 966 Handle<Object> getter = v8::FromCData(isolate, &ModuleGetExport);
970 Handle<Object> setter = v8::FromCData(isolate, &ModuleSetExport); 967 Handle<Object> setter = v8::FromCData(isolate, &ModuleSetExport);
971 info->set_getter(*getter); 968 info->set_getter(*getter);
972 if (!(attributes & ReadOnly)) info->set_setter(*setter); 969 if (!(attributes & ReadOnly)) info->set_setter(*setter);
973 return info; 970 return info;
974 } 971 }
975 972
976 973
977 } } // namespace v8::internal 974 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/bootstrapper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698