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

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

Issue 795573005: ES6 computed property names (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: moar cleanup Created 6 years 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
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 1572 matching lines...) Expand 10 before | Expand all | Expand 10 after
1583 } 1583 }
1584 1584
1585 1585
1586 RUNTIME_FUNCTION(RuntimeReference_ClassOf) { 1586 RUNTIME_FUNCTION(RuntimeReference_ClassOf) {
1587 SealHandleScope shs(isolate); 1587 SealHandleScope shs(isolate);
1588 DCHECK(args.length() == 1); 1588 DCHECK(args.length() == 1);
1589 CONVERT_ARG_CHECKED(Object, obj, 0); 1589 CONVERT_ARG_CHECKED(Object, obj, 0);
1590 if (!obj->IsJSReceiver()) return isolate->heap()->null_value(); 1590 if (!obj->IsJSReceiver()) return isolate->heap()->null_value();
1591 return JSReceiver::cast(obj)->class_name(); 1591 return JSReceiver::cast(obj)->class_name();
1592 } 1592 }
1593
1594
1595 RUNTIME_FUNCTION(Runtime_DefineGetterPropertyUnchecked) {
1596 HandleScope scope(isolate);
1597 DCHECK(args.length() == 3);
1598 CONVERT_ARG_HANDLE_CHECKED(JSObject, object, 0);
1599 CONVERT_ARG_HANDLE_CHECKED(Object, key, 1);
Dmitry Lomov (no reviews) 2014/12/12 15:11:58 Feels weird that DefineDataPropertyUnchecked takes
arv (Not doing code reviews) 2014/12/12 16:49:34 I agree. I ended up changing all the runtime func
1600 CONVERT_ARG_HANDLE_CHECKED(JSFunction, getter, 2);
1601
1602 Handle<Name> name;
1603 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, name,
1604 Runtime::ToName(isolate, key));
1605
1606 RETURN_FAILURE_ON_EXCEPTION(
1607 isolate,
1608 JSObject::DefineAccessor(object, name, getter,
1609 isolate->factory()->null_value(), NONE));
1610 return isolate->heap()->undefined_value();
1611 }
1612
1613
1614 RUNTIME_FUNCTION(Runtime_DefineSetterPropertyUnchecked) {
1615 HandleScope scope(isolate);
1616 DCHECK(args.length() == 3);
1617 CONVERT_ARG_HANDLE_CHECKED(JSObject, object, 0);
1618 CONVERT_ARG_HANDLE_CHECKED(Object, key, 1);
1619 CONVERT_ARG_HANDLE_CHECKED(JSFunction, setter, 2);
1620
1621 Handle<Name> name;
1622 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, name,
1623 Runtime::ToName(isolate, key));
1624 RETURN_FAILURE_ON_EXCEPTION(
1625 isolate,
1626 JSObject::DefineAccessor(object, name, isolate->factory()->null_value(),
1627 setter, NONE));
1628 return isolate->heap()->undefined_value();
1629 }
1593 } 1630 }
1594 } // namespace v8::internal 1631 } // namespace v8::internal
OLDNEW
« src/preparser.h ('K') | « src/runtime/runtime-classes.cc ('k') | src/typing.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698