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

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

Issue 985643003: [es6] Throw TypeError for computed static prototype property name (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Inline BuildThrowStaticPrototype Created 5 years, 9 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.h ('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 <stdlib.h> 5 #include <stdlib.h>
6 #include <limits> 6 #include <limits>
7 7
8 #include "src/v8.h" 8 #include "src/v8.h"
9 9
10 #include "src/isolate-inl.h" 10 #include "src/isolate-inl.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 49
50 RUNTIME_FUNCTION(Runtime_ThrowArrayNotSubclassableError) { 50 RUNTIME_FUNCTION(Runtime_ThrowArrayNotSubclassableError) {
51 HandleScope scope(isolate); 51 HandleScope scope(isolate);
52 DCHECK(args.length() == 0); 52 DCHECK(args.length() == 0);
53 THROW_NEW_ERROR_RETURN_FAILURE( 53 THROW_NEW_ERROR_RETURN_FAILURE(
54 isolate, 54 isolate,
55 NewTypeError("array_not_subclassable", HandleVector<Object>(NULL, 0))); 55 NewTypeError("array_not_subclassable", HandleVector<Object>(NULL, 0)));
56 } 56 }
57 57
58 58
59 static Object* ThrowStaticPrototypeError(Isolate* isolate) {
60 THROW_NEW_ERROR_RETURN_FAILURE(
61 isolate, NewTypeError("static_prototype", HandleVector<Object>(NULL, 0)));
62 }
63
64
65 RUNTIME_FUNCTION(Runtime_ThrowStaticPrototypeError) {
66 HandleScope scope(isolate);
67 DCHECK(args.length() == 0);
68 return ThrowStaticPrototypeError(isolate);
69 }
70
71
72 RUNTIME_FUNCTION(Runtime_ThrowIfStaticPrototype) {
73 HandleScope scope(isolate);
74 DCHECK(args.length() == 1);
75 CONVERT_ARG_HANDLE_CHECKED(Name, name, 0);
76 if (Name::Equals(name, isolate->factory()->prototype_string())) {
77 return ThrowStaticPrototypeError(isolate);
78 }
79 return *name;
80 }
81
82
59 RUNTIME_FUNCTION(Runtime_ToMethod) { 83 RUNTIME_FUNCTION(Runtime_ToMethod) {
60 HandleScope scope(isolate); 84 HandleScope scope(isolate);
61 DCHECK(args.length() == 2); 85 DCHECK(args.length() == 2);
62 CONVERT_ARG_HANDLE_CHECKED(JSFunction, fun, 0); 86 CONVERT_ARG_HANDLE_CHECKED(JSFunction, fun, 0);
63 CONVERT_ARG_HANDLE_CHECKED(JSObject, home_object, 1); 87 CONVERT_ARG_HANDLE_CHECKED(JSObject, home_object, 1);
64 Handle<JSFunction> clone = JSFunction::CloneClosure(fun); 88 Handle<JSFunction> clone = JSFunction::CloneClosure(fun);
65 Handle<Symbol> home_object_symbol(isolate->heap()->home_object_symbol()); 89 Handle<Symbol> home_object_symbol(isolate->heap()->home_object_symbol());
66 JSObject::SetOwnPropertyIgnoreAttributes(clone, home_object_symbol, 90 JSObject::SetOwnPropertyIgnoreAttributes(clone, home_object_symbol,
67 home_object, DONT_ENUM).Assert(); 91 home_object, DONT_ENUM).Assert();
68 return *clone; 92 return *clone;
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after
428 return *isolate->factory()->undefined_value(); 452 return *isolate->factory()->undefined_value();
429 } 453 }
430 454
431 455
432 RUNTIME_FUNCTION(Runtime_DefaultConstructorCallSuper) { 456 RUNTIME_FUNCTION(Runtime_DefaultConstructorCallSuper) {
433 UNREACHABLE(); 457 UNREACHABLE();
434 return nullptr; 458 return nullptr;
435 } 459 }
436 } 460 }
437 } // namespace v8::internal 461 } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/runtime/runtime.h ('k') | src/x64/full-codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698