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

Side by Side Diff: src/runtime.cc

Issue 2819034: Add ES5 Object.isExtensible and Object.preventExtensions. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years, 5 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 | « src/runtime.h ('k') | src/v8natives.js » ('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 2006-2009 the V8 project authors. All rights reserved. 1 // Copyright 2006-2009 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 660 matching lines...) Expand 10 before | Expand all | Expand 10 after
671 elms->set(VALUE_INDEX, result.GetLazyValue()); 671 elms->set(VALUE_INDEX, result.GetLazyValue());
672 elms->set(WRITABLE_INDEX, Heap::ToBoolean(!result.IsReadOnly())); 672 elms->set(WRITABLE_INDEX, Heap::ToBoolean(!result.IsReadOnly()));
673 } 673 }
674 674
675 elms->set(ENUMERABLE_INDEX, Heap::ToBoolean(!result.IsDontEnum())); 675 elms->set(ENUMERABLE_INDEX, Heap::ToBoolean(!result.IsDontEnum()));
676 elms->set(CONFIGURABLE_INDEX, Heap::ToBoolean(!result.IsDontDelete())); 676 elms->set(CONFIGURABLE_INDEX, Heap::ToBoolean(!result.IsDontDelete()));
677 return *desc; 677 return *desc;
678 } 678 }
679 679
680 680
681 static Object* Runtime_PreventExtensions(Arguments args) {
682 ASSERT(args.length() == 1);
683 CONVERT_CHECKED(JSObject, obj, args[0]);
684 return obj->PreventExtensions();
685 }
686
681 static Object* Runtime_IsExtensible(Arguments args) { 687 static Object* Runtime_IsExtensible(Arguments args) {
682 ASSERT(args.length() == 1); 688 ASSERT(args.length() == 1);
683 CONVERT_CHECKED(JSObject, obj, args[0]); 689 CONVERT_CHECKED(JSObject, obj, args[0]);
684 return obj->map()->is_extensible() ? Heap::true_value() 690 return obj->map()->is_extensible() ? Heap::true_value()
685 : Heap::false_value(); 691 : Heap::false_value();
686 } 692 }
687 693
688 694
689 static Object* Runtime_RegExpCompile(Arguments args) { 695 static Object* Runtime_RegExpCompile(Arguments args) {
690 HandleScope scope; 696 HandleScope scope;
(...skipping 9704 matching lines...) Expand 10 before | Expand all | Expand 10 after
10395 } else { 10401 } else {
10396 // Handle last resort GC and make sure to allow future allocations 10402 // Handle last resort GC and make sure to allow future allocations
10397 // to grow the heap without causing GCs (if possible). 10403 // to grow the heap without causing GCs (if possible).
10398 Counters::gc_last_resort_from_js.Increment(); 10404 Counters::gc_last_resort_from_js.Increment();
10399 Heap::CollectAllGarbage(false); 10405 Heap::CollectAllGarbage(false);
10400 } 10406 }
10401 } 10407 }
10402 10408
10403 10409
10404 } } // namespace v8::internal 10410 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/runtime.h ('k') | src/v8natives.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698