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

Side by Side Diff: src/builtins.cc

Issue 1416433003: [es6] Partially implement Reflect.getPrototypeOf. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 2 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/builtins.h ('k') | test/mjsunit/harmony/reflect.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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/builtins.h" 5 #include "src/builtins.h"
6 6
7 #include "src/api.h" 7 #include "src/api.h"
8 #include "src/api-natives.h" 8 #include "src/api-natives.h"
9 #include "src/arguments.h" 9 #include "src/arguments.h"
10 #include "src/base/once.h" 10 #include "src/base/once.h"
(...skipping 1481 matching lines...) Expand 10 before | Expand all | Expand 10 after
1492 1492
1493 Handle<Object> result; 1493 Handle<Object> result;
1494 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( 1494 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
1495 isolate, result, Object::GetPropertyOrElement( 1495 isolate, result, Object::GetPropertyOrElement(
1496 Handle<JSReceiver>::cast(target), name, receiver)); 1496 Handle<JSReceiver>::cast(target), name, receiver));
1497 1497
1498 return *result; 1498 return *result;
1499 } 1499 }
1500 1500
1501 1501
1502 // ES6 section 26.1.8 Reflect.getPrototypeOf
1503 BUILTIN(ReflectGetPrototypeOf) {
1504 HandleScope scope(isolate);
1505 DCHECK_EQ(2, args.length());
1506 Handle<Object> target = args.at<Object>(1);
1507
1508 if (!target->IsJSReceiver()) {
1509 THROW_NEW_ERROR_RETURN_FAILURE(
1510 isolate, NewTypeError(MessageTemplate::kCalledOnNonObject,
1511 isolate->factory()->NewStringFromAsciiChecked(
1512 "Reflect.getPrototypeOf")));
1513 }
1514
1515 return *Object::GetPrototype(isolate, target);
1516 }
1517
1518
1502 // ES6 section 26.1.9 Reflect.has 1519 // ES6 section 26.1.9 Reflect.has
1503 BUILTIN(ReflectHas) { 1520 BUILTIN(ReflectHas) {
1504 HandleScope scope(isolate); 1521 HandleScope scope(isolate);
1505 DCHECK_EQ(3, args.length()); 1522 DCHECK_EQ(3, args.length());
1506 Handle<Object> target = args.at<Object>(1); 1523 Handle<Object> target = args.at<Object>(1);
1507 Handle<Object> key = args.at<Object>(2); 1524 Handle<Object> key = args.at<Object>(2);
1508 1525
1509 if (!target->IsJSReceiver()) { 1526 if (!target->IsJSReceiver()) {
1510 THROW_NEW_ERROR_RETURN_FAILURE( 1527 THROW_NEW_ERROR_RETURN_FAILURE(
1511 isolate, NewTypeError(MessageTemplate::kCalledOnNonObject, 1528 isolate, NewTypeError(MessageTemplate::kCalledOnNonObject,
(...skipping 707 matching lines...) Expand 10 before | Expand all | Expand 10 after
2219 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C) 2236 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C)
2220 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A) 2237 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A)
2221 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H) 2238 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H)
2222 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) 2239 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A)
2223 #undef DEFINE_BUILTIN_ACCESSOR_C 2240 #undef DEFINE_BUILTIN_ACCESSOR_C
2224 #undef DEFINE_BUILTIN_ACCESSOR_A 2241 #undef DEFINE_BUILTIN_ACCESSOR_A
2225 2242
2226 2243
2227 } // namespace internal 2244 } // namespace internal
2228 } // namespace v8 2245 } // namespace v8
OLDNEW
« no previous file with comments | « src/builtins.h ('k') | test/mjsunit/harmony/reflect.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698