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

Side by Side Diff: src/runtime.cc

Issue 6515005: Strict mode delete. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 10 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
OLDNEW
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 3896 matching lines...) Expand 10 before | Expand all | Expand 10 after
3907 attributes = static_cast<PropertyAttributes>(unchecked_value); 3907 attributes = static_cast<PropertyAttributes>(unchecked_value);
3908 } 3908 }
3909 3909
3910 return object-> 3910 return object->
3911 SetLocalPropertyIgnoreAttributes(name, args[2], attributes); 3911 SetLocalPropertyIgnoreAttributes(name, args[2], attributes);
3912 } 3912 }
3913 3913
3914 3914
3915 static MaybeObject* Runtime_DeleteProperty(Arguments args) { 3915 static MaybeObject* Runtime_DeleteProperty(Arguments args) {
3916 NoHandleAllocation ha; 3916 NoHandleAllocation ha;
3917 ASSERT(args.length() == 2); 3917 ASSERT(args.length() == 3);
3918 3918
3919 CONVERT_CHECKED(JSObject, object, args[0]); 3919 CONVERT_CHECKED(JSObject, object, args[0]);
3920 CONVERT_CHECKED(String, key, args[1]); 3920 CONVERT_CHECKED(String, key, args[1]);
3921 return object->DeleteProperty(key, JSObject::NORMAL_DELETION); 3921 CONVERT_SMI_CHECKED(strict, args[2]);
3922 return object->DeleteProperty(key, strict == kStrictMode
3923 ? JSObject::STRICT_DELETION
3924 : JSObject::NORMAL_DELETION);
3922 } 3925 }
3923 3926
3924 3927
3925 static Object* HasLocalPropertyImplementation(Handle<JSObject> object, 3928 static Object* HasLocalPropertyImplementation(Handle<JSObject> object,
3926 Handle<String> key) { 3929 Handle<String> key) {
3927 if (object->HasLocalProperty(*key)) return Heap::true_value(); 3930 if (object->HasLocalProperty(*key)) return Heap::true_value();
3928 // Handle hidden prototypes. If there's a hidden prototype above this thing 3931 // Handle hidden prototypes. If there's a hidden prototype above this thing
3929 // then we have to check it for properties, because they are supposed to 3932 // then we have to check it for properties, because they are supposed to
3930 // look like they are on this object. 3933 // look like they are on this object.
3931 Handle<Object> proto(object->GetPrototype()); 3934 Handle<Object> proto(object->GetPrototype());
(...skipping 7166 matching lines...) Expand 10 before | Expand all | Expand 10 after
11098 } else { 11101 } else {
11099 // Handle last resort GC and make sure to allow future allocations 11102 // Handle last resort GC and make sure to allow future allocations
11100 // to grow the heap without causing GCs (if possible). 11103 // to grow the heap without causing GCs (if possible).
11101 Counters::gc_last_resort_from_js.Increment(); 11104 Counters::gc_last_resort_from_js.Increment();
11102 Heap::CollectAllGarbage(false); 11105 Heap::CollectAllGarbage(false);
11103 } 11106 }
11104 } 11107 }
11105 11108
11106 11109
11107 } } // namespace v8::internal 11110 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698