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

Side by Side Diff: src/bootstrapper.cc

Issue 1552223002: ThrowTypeError should not be constructable, so shouldn't have a prototype. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 11 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 | « no previous file | test/mjsunit/regress/regress-crbug-573858.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 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/bootstrapper.h" 5 #include "src/bootstrapper.h"
6 6
7 #include "src/accessors.h" 7 #include "src/accessors.h"
8 #include "src/api-natives.h" 8 #include "src/api-natives.h"
9 #include "src/code-stubs.h" 9 #include "src/code-stubs.h"
10 #include "src/extensions/externalize-string-extension.h" 10 #include "src/extensions/externalize-string-extension.h"
(...skipping 654 matching lines...) Expand 10 before | Expand all | Expand 10 after
665 665
666 666
667 // Creates the %ThrowTypeError% function. 667 // Creates the %ThrowTypeError% function.
668 Handle<JSFunction> Genesis::GetThrowTypeErrorIntrinsic( 668 Handle<JSFunction> Genesis::GetThrowTypeErrorIntrinsic(
669 Builtins::Name builtin_name) { 669 Builtins::Name builtin_name) {
670 Handle<String> name = 670 Handle<String> name =
671 factory()->InternalizeOneByteString(STATIC_CHAR_VECTOR("ThrowTypeError")); 671 factory()->InternalizeOneByteString(STATIC_CHAR_VECTOR("ThrowTypeError"));
672 Handle<Code> code(isolate()->builtins()->builtin(builtin_name)); 672 Handle<Code> code(isolate()->builtins()->builtin(builtin_name));
673 Handle<JSFunction> function = 673 Handle<JSFunction> function =
674 factory()->NewFunctionWithoutPrototype(name, code); 674 factory()->NewFunctionWithoutPrototype(name, code);
675 function->set_map(native_context()->sloppy_function_map());
676 function->shared()->DontAdaptArguments(); 675 function->shared()->DontAdaptArguments();
677 676
678 // %ThrowTypeError% must not have a name property. 677 // %ThrowTypeError% must not have a name property.
679 if (JSReceiver::DeleteProperty(function, factory()->name_string()) 678 if (JSReceiver::DeleteProperty(function, factory()->name_string())
680 .IsNothing()) { 679 .IsNothing()) {
681 DCHECK(false); 680 DCHECK(false);
682 } 681 }
683 682
684 // length needs to be non configurable. 683 // length needs to be non configurable.
685 Handle<Object> value(Smi::FromInt(function->shared()->length()), isolate()); 684 Handle<Object> value(Smi::FromInt(function->shared()->length()), isolate());
(...skipping 2726 matching lines...) Expand 10 before | Expand all | Expand 10 after
3412 } 3411 }
3413 3412
3414 3413
3415 // Called when the top-level V8 mutex is destroyed. 3414 // Called when the top-level V8 mutex is destroyed.
3416 void Bootstrapper::FreeThreadResources() { 3415 void Bootstrapper::FreeThreadResources() {
3417 DCHECK(!IsActive()); 3416 DCHECK(!IsActive());
3418 } 3417 }
3419 3418
3420 } // namespace internal 3419 } // namespace internal
3421 } // namespace v8 3420 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-crbug-573858.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698