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

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: Cleanup comment 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
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 RUNTIME_FUNCTION(Runtime_ThrowIfStaticPrototype) {
60 HandleScope scope(isolate);
61 DCHECK(args.length() == 1);
62 CONVERT_ARG_HANDLE_CHECKED(Name, name, 0);
63 if (Name::Equals(name, isolate->factory()->prototype_string())) {
64 THROW_NEW_ERROR_RETURN_FAILURE(
65 isolate,
66 NewTypeError("static_prototype", HandleVector<Object>(NULL, 0)));
67 }
68 return *name;
69 }
70
71
59 RUNTIME_FUNCTION(Runtime_ToMethod) { 72 RUNTIME_FUNCTION(Runtime_ToMethod) {
60 HandleScope scope(isolate); 73 HandleScope scope(isolate);
61 DCHECK(args.length() == 2); 74 DCHECK(args.length() == 2);
62 CONVERT_ARG_HANDLE_CHECKED(JSFunction, fun, 0); 75 CONVERT_ARG_HANDLE_CHECKED(JSFunction, fun, 0);
63 CONVERT_ARG_HANDLE_CHECKED(JSObject, home_object, 1); 76 CONVERT_ARG_HANDLE_CHECKED(JSObject, home_object, 1);
64 Handle<JSFunction> clone = JSFunction::CloneClosure(fun); 77 Handle<JSFunction> clone = JSFunction::CloneClosure(fun);
65 Handle<Symbol> home_object_symbol(isolate->heap()->home_object_symbol()); 78 Handle<Symbol> home_object_symbol(isolate->heap()->home_object_symbol());
66 JSObject::SetOwnPropertyIgnoreAttributes(clone, home_object_symbol, 79 JSObject::SetOwnPropertyIgnoreAttributes(clone, home_object_symbol,
67 home_object, DONT_ENUM).Assert(); 80 home_object, DONT_ENUM).Assert();
68 return *clone; 81 return *clone;
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after
428 return *isolate->factory()->undefined_value(); 441 return *isolate->factory()->undefined_value();
429 } 442 }
430 443
431 444
432 RUNTIME_FUNCTION(Runtime_DefaultConstructorCallSuper) { 445 RUNTIME_FUNCTION(Runtime_DefaultConstructorCallSuper) {
433 UNREACHABLE(); 446 UNREACHABLE();
434 return nullptr; 447 return nullptr;
435 } 448 }
436 } 449 }
437 } // namespace v8::internal 450 } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698