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

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

Issue 962263002: Disallow subclassing Arrays. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fixes for debug-code issues 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/builtins-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 29 matching lines...) Expand all
40 40
41 RUNTIME_FUNCTION(Runtime_ThrowConstructorNonCallableError) { 41 RUNTIME_FUNCTION(Runtime_ThrowConstructorNonCallableError) {
42 HandleScope scope(isolate); 42 HandleScope scope(isolate);
43 DCHECK(args.length() == 0); 43 DCHECK(args.length() == 0);
44 THROW_NEW_ERROR_RETURN_FAILURE( 44 THROW_NEW_ERROR_RETURN_FAILURE(
45 isolate, 45 isolate,
46 NewTypeError("constructor_noncallable", HandleVector<Object>(NULL, 0))); 46 NewTypeError("constructor_noncallable", HandleVector<Object>(NULL, 0)));
47 } 47 }
48 48
49 49
50 RUNTIME_FUNCTION(Runtime_ThrowArrayNotSubclassableError) {
51 HandleScope scope(isolate);
52 DCHECK(args.length() == 0);
53 THROW_NEW_ERROR_RETURN_FAILURE(
54 isolate,
55 NewTypeError("array_not_subclassable", HandleVector<Object>(NULL, 0)));
56 }
57
58
50 RUNTIME_FUNCTION(Runtime_ToMethod) { 59 RUNTIME_FUNCTION(Runtime_ToMethod) {
51 HandleScope scope(isolate); 60 HandleScope scope(isolate);
52 DCHECK(args.length() == 2); 61 DCHECK(args.length() == 2);
53 CONVERT_ARG_HANDLE_CHECKED(JSFunction, fun, 0); 62 CONVERT_ARG_HANDLE_CHECKED(JSFunction, fun, 0);
54 CONVERT_ARG_HANDLE_CHECKED(JSObject, home_object, 1); 63 CONVERT_ARG_HANDLE_CHECKED(JSObject, home_object, 1);
55 Handle<JSFunction> clone = JSFunction::CloneClosure(fun); 64 Handle<JSFunction> clone = JSFunction::CloneClosure(fun);
56 Handle<Symbol> home_object_symbol(isolate->heap()->home_object_symbol()); 65 Handle<Symbol> home_object_symbol(isolate->heap()->home_object_symbol());
57 JSObject::SetOwnPropertyIgnoreAttributes(clone, home_object_symbol, 66 JSObject::SetOwnPropertyIgnoreAttributes(clone, home_object_symbol,
58 home_object, DONT_ENUM).Assert(); 67 home_object, DONT_ENUM).Assert();
59 return *clone; 68 return *clone;
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after
419 return *isolate->factory()->undefined_value(); 428 return *isolate->factory()->undefined_value();
420 } 429 }
421 430
422 431
423 RUNTIME_FUNCTION(RuntimeReference_DefaultConstructorCallSuper) { 432 RUNTIME_FUNCTION(RuntimeReference_DefaultConstructorCallSuper) {
424 UNREACHABLE(); 433 UNREACHABLE();
425 return nullptr; 434 return nullptr;
426 } 435 }
427 } 436 }
428 } // namespace v8::internal 437 } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/runtime/runtime.h ('k') | src/x64/builtins-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698