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

Side by Side Diff: src/objects.cc

Issue 2474843003: Allow the global object to be frozen through the global template (Closed)
Patch Set: Format Created 4 years, 1 month 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 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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/objects.h" 5 #include "src/objects.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 #include <iomanip> 8 #include <iomanip>
9 #include <memory> 9 #include <memory>
10 #include <sstream> 10 #include <sstream>
(...skipping 15530 matching lines...) Expand 10 before | Expand all | Expand 10 after
15541 real_receiver = PrototypeIterator::GetCurrent<JSObject>(iter); 15541 real_receiver = PrototypeIterator::GetCurrent<JSObject>(iter);
15542 iter.Advance(); 15542 iter.Advance();
15543 all_extensible = all_extensible && real_receiver->map()->is_extensible(); 15543 all_extensible = all_extensible && real_receiver->map()->is_extensible();
15544 } 15544 }
15545 } 15545 }
15546 Handle<Map> map(real_receiver->map()); 15546 Handle<Map> map(real_receiver->map());
15547 15547
15548 // Nothing to do if prototype is already set. 15548 // Nothing to do if prototype is already set.
15549 if (map->prototype() == *value) return Just(true); 15549 if (map->prototype() == *value) return Just(true);
15550 15550
15551 bool immutable_proto = object->map()->is_immutable_proto(); 15551 bool immutable_proto = map->is_immutable_proto();
15552 if (immutable_proto) { 15552 if (immutable_proto) {
15553 RETURN_FAILURE( 15553 RETURN_FAILURE(
15554 isolate, should_throw, 15554 isolate, should_throw,
15555 NewTypeError(MessageTemplate::kImmutablePrototypeSet, object)); 15555 NewTypeError(MessageTemplate::kImmutablePrototypeSet, object));
15556 } 15556 }
15557 15557
15558 // From 8.6.2 Object Internal Methods 15558 // From 8.6.2 Object Internal Methods
15559 // ... 15559 // ...
15560 // In addition, if [[Extensible]] is false the value of the [[Class]] and 15560 // In addition, if [[Extensible]] is false the value of the [[Class]] and
15561 // [[Prototype]] internal properties of the object may not be modified. 15561 // [[Prototype]] internal properties of the object may not be modified.
(...skipping 4700 matching lines...) Expand 10 before | Expand all | Expand 10 after
20262 ns, Accessors::ModuleNamespaceEntryInfo(isolate, name, attr)) 20262 ns, Accessors::ModuleNamespaceEntryInfo(isolate, name, attr))
20263 .Check(); 20263 .Check();
20264 } 20264 }
20265 JSObject::PreventExtensions(ns, THROW_ON_ERROR).ToChecked(); 20265 JSObject::PreventExtensions(ns, THROW_ON_ERROR).ToChecked();
20266 20266
20267 return ns; 20267 return ns;
20268 } 20268 }
20269 20269
20270 } // namespace internal 20270 } // namespace internal
20271 } // namespace v8 20271 } // namespace v8
OLDNEW
« src/bootstrapper.cc ('K') | « src/bootstrapper.cc ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698