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

Side by Side Diff: src/runtime.cc

Issue 8834: Introduce access control in propertyIsEnumerable.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 12 years, 1 month 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 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 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 1887 matching lines...) Expand 10 before | Expand all | Expand 10 after
1898 ASSERT(args.length() == 2); 1898 ASSERT(args.length() == 2);
1899 1899
1900 CONVERT_CHECKED(JSObject, object, args[0]); 1900 CONVERT_CHECKED(JSObject, object, args[0]);
1901 CONVERT_CHECKED(String, key, args[1]); 1901 CONVERT_CHECKED(String, key, args[1]);
1902 1902
1903 uint32_t index; 1903 uint32_t index;
1904 if (key->AsArrayIndex(&index)) { 1904 if (key->AsArrayIndex(&index)) {
1905 return Heap::ToBoolean(object->HasElement(index)); 1905 return Heap::ToBoolean(object->HasElement(index));
1906 } 1906 }
1907 1907
1908 LookupResult result; 1908 PropertyAttributes att = object->GetLocalPropertyAttribute(key);
1909 object->LocalLookup(key, &result); 1909 return Heap::ToBoolean(att != ABSENT && att != DONT_ENUM);
1910 if (!result.IsProperty()) return Heap::false_value();
1911 return Heap::ToBoolean(!result.IsDontEnum());
1912 } 1910 }
1913 1911
1914 1912
1915 static Object* Runtime_GetPropertyNames(Arguments args) { 1913 static Object* Runtime_GetPropertyNames(Arguments args) {
1916 HandleScope scope; 1914 HandleScope scope;
1917 ASSERT(args.length() == 1); 1915 ASSERT(args.length() == 1);
1918 1916
1919 CONVERT_CHECKED(JSObject, raw_object, args[0]); 1917 CONVERT_CHECKED(JSObject, raw_object, args[0]);
1920 Handle<JSObject> object(raw_object); 1918 Handle<JSObject> object(raw_object);
1921 return *GetKeysFor(object); 1919 return *GetKeysFor(object);
(...skipping 3601 matching lines...) Expand 10 before | Expand all | Expand 10 after
5523 5521
5524 void Runtime::PerformGC(Object* result) { 5522 void Runtime::PerformGC(Object* result) {
5525 Failure* failure = Failure::cast(result); 5523 Failure* failure = Failure::cast(result);
5526 // Try to do a garbage collection; ignore it if it fails. The C 5524 // Try to do a garbage collection; ignore it if it fails. The C
5527 // entry stub will throw an out-of-memory exception in that case. 5525 // entry stub will throw an out-of-memory exception in that case.
5528 Heap::CollectGarbage(failure->requested(), failure->allocation_space()); 5526 Heap::CollectGarbage(failure->requested(), failure->allocation_space());
5529 } 5527 }
5530 5528
5531 5529
5532 } } // namespace v8::internal 5530 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698