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

Side by Side Diff: src/runtime/runtime-object.cc

Issue 896643003: Class methods should be non enumerable (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Use LanguageMode Created 5 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
« no previous file with comments | « src/runtime/runtime-classes.cc ('k') | src/x64/full-codegen-x64.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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/arguments.h" 7 #include "src/arguments.h"
8 #include "src/bootstrapper.h" 8 #include "src/bootstrapper.h"
9 #include "src/debug.h" 9 #include "src/debug.h"
10 #include "src/runtime/runtime.h" 10 #include "src/runtime/runtime.h"
(...skipping 1571 matching lines...) Expand 10 before | Expand all | Expand 10 after
1582 SealHandleScope shs(isolate); 1582 SealHandleScope shs(isolate);
1583 DCHECK(args.length() == 1); 1583 DCHECK(args.length() == 1);
1584 CONVERT_ARG_CHECKED(Object, obj, 0); 1584 CONVERT_ARG_CHECKED(Object, obj, 0);
1585 if (!obj->IsJSReceiver()) return isolate->heap()->null_value(); 1585 if (!obj->IsJSReceiver()) return isolate->heap()->null_value();
1586 return JSReceiver::cast(obj)->class_name(); 1586 return JSReceiver::cast(obj)->class_name();
1587 } 1587 }
1588 1588
1589 1589
1590 RUNTIME_FUNCTION(Runtime_DefineGetterPropertyUnchecked) { 1590 RUNTIME_FUNCTION(Runtime_DefineGetterPropertyUnchecked) {
1591 HandleScope scope(isolate); 1591 HandleScope scope(isolate);
1592 DCHECK(args.length() == 3); 1592 DCHECK(args.length() == 4);
1593 CONVERT_ARG_HANDLE_CHECKED(JSObject, object, 0); 1593 CONVERT_ARG_HANDLE_CHECKED(JSObject, object, 0);
1594 CONVERT_ARG_HANDLE_CHECKED(Name, name, 1); 1594 CONVERT_ARG_HANDLE_CHECKED(Name, name, 1);
1595 CONVERT_ARG_HANDLE_CHECKED(JSFunction, getter, 2); 1595 CONVERT_ARG_HANDLE_CHECKED(JSFunction, getter, 2);
1596 CONVERT_SMI_ARG_CHECKED(unchecked, 3);
1597 RUNTIME_ASSERT((unchecked & ~(READ_ONLY | DONT_ENUM | DONT_DELETE)) == 0);
1598 PropertyAttributes attrs = static_cast<PropertyAttributes>(unchecked);
1596 1599
1597 RETURN_FAILURE_ON_EXCEPTION( 1600 RETURN_FAILURE_ON_EXCEPTION(
1598 isolate, 1601 isolate,
1599 JSObject::DefineAccessor(object, name, getter, 1602 JSObject::DefineAccessor(object, name, getter,
1600 isolate->factory()->null_value(), NONE)); 1603 isolate->factory()->null_value(), attrs));
1601 return isolate->heap()->undefined_value(); 1604 return isolate->heap()->undefined_value();
1602 } 1605 }
1603 1606
1604 1607
1605 RUNTIME_FUNCTION(Runtime_DefineSetterPropertyUnchecked) { 1608 RUNTIME_FUNCTION(Runtime_DefineSetterPropertyUnchecked) {
1606 HandleScope scope(isolate); 1609 HandleScope scope(isolate);
1607 DCHECK(args.length() == 3); 1610 DCHECK(args.length() == 4);
1608 CONVERT_ARG_HANDLE_CHECKED(JSObject, object, 0); 1611 CONVERT_ARG_HANDLE_CHECKED(JSObject, object, 0);
1609 CONVERT_ARG_HANDLE_CHECKED(Name, name, 1); 1612 CONVERT_ARG_HANDLE_CHECKED(Name, name, 1);
1610 CONVERT_ARG_HANDLE_CHECKED(JSFunction, setter, 2); 1613 CONVERT_ARG_HANDLE_CHECKED(JSFunction, setter, 2);
1614 CONVERT_SMI_ARG_CHECKED(unchecked, 3);
1615 RUNTIME_ASSERT((unchecked & ~(READ_ONLY | DONT_ENUM | DONT_DELETE)) == 0);
1616 PropertyAttributes attrs = static_cast<PropertyAttributes>(unchecked);
1611 1617
1612 RETURN_FAILURE_ON_EXCEPTION( 1618 RETURN_FAILURE_ON_EXCEPTION(
1613 isolate, 1619 isolate,
1614 JSObject::DefineAccessor(object, name, isolate->factory()->null_value(), 1620 JSObject::DefineAccessor(object, name, isolate->factory()->null_value(),
1615 setter, NONE)); 1621 setter, attrs));
1616 return isolate->heap()->undefined_value(); 1622 return isolate->heap()->undefined_value();
1617 } 1623 }
1618 } 1624 }
1619 } // namespace v8::internal 1625 } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/runtime/runtime-classes.cc ('k') | src/x64/full-codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698