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

Side by Side Diff: src/accessors.cc

Issue 183683022: Enable Object.observe by default (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') | src/ic.cc » ('J')
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 602 matching lines...) Expand 10 before | Expand all | Expand 10 after
613 Handle<Object> value(value_raw, isolate); 613 Handle<Object> value(value_raw, isolate);
614 if (!function->should_have_prototype()) { 614 if (!function->should_have_prototype()) {
615 // Since we hit this accessor, object will have no prototype property. 615 // Since we hit this accessor, object will have no prototype property.
616 Handle<Object> result = JSObject::SetLocalPropertyIgnoreAttributes(object, 616 Handle<Object> result = JSObject::SetLocalPropertyIgnoreAttributes(object,
617 isolate->factory()->prototype_string(), value, NONE); 617 isolate->factory()->prototype_string(), value, NONE);
618 RETURN_IF_EMPTY_HANDLE(isolate, result); 618 RETURN_IF_EMPTY_HANDLE(isolate, result);
619 return *result; 619 return *result;
620 } 620 }
621 621
622 Handle<Object> old_value; 622 Handle<Object> old_value;
623 bool is_observed = 623 bool is_observed =
rossberg 2014/03/06 08:41:35 Nit: does this fit one line now?
rafaelw 2014/03/07 04:33:06 Yes. done On 2014/03/06 08:41:35, rossberg wrote:
624 FLAG_harmony_observation &&
625 *function == *object && 624 *function == *object &&
626 function->map()->is_observed(); 625 function->map()->is_observed();
627 if (is_observed) { 626 if (is_observed) {
628 if (function->has_prototype()) 627 if (function->has_prototype())
629 old_value = handle(function->prototype(), isolate); 628 old_value = handle(function->prototype(), isolate);
630 else 629 else
631 old_value = isolate->factory()->NewFunctionPrototype(function); 630 old_value = isolate->factory()->NewFunctionPrototype(function);
632 } 631 }
633 632
634 JSFunction::SetPrototype(function, value); 633 JSFunction::SetPrototype(function, value);
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after
988 info->set_data(Smi::FromInt(index)); 987 info->set_data(Smi::FromInt(index));
989 Handle<Object> getter = v8::FromCData(isolate, &ModuleGetExport); 988 Handle<Object> getter = v8::FromCData(isolate, &ModuleGetExport);
990 Handle<Object> setter = v8::FromCData(isolate, &ModuleSetExport); 989 Handle<Object> setter = v8::FromCData(isolate, &ModuleSetExport);
991 info->set_getter(*getter); 990 info->set_getter(*getter);
992 if (!(attributes & ReadOnly)) info->set_setter(*setter); 991 if (!(attributes & ReadOnly)) info->set_setter(*setter);
993 return info; 992 return info;
994 } 993 }
995 994
996 995
997 } } // namespace v8::internal 996 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/bootstrapper.cc » ('j') | src/ic.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698