V8 API Reference, 7.2.502.16 (for Deno 0.2.4)
builtins-collections.cc
1 // Copyright 2016 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #include "src/builtins/builtins-utils-inl.h"
6 #include "src/builtins/builtins.h"
7 #include "src/counters.h"
8 #include "src/objects-inl.h"
9 #include "src/objects/js-collection-inl.h"
10 
11 namespace v8 {
12 namespace internal {
13 
14 BUILTIN(MapPrototypeClear) {
15  HandleScope scope(isolate);
16  const char* const kMethodName = "Map.prototype.clear";
17  CHECK_RECEIVER(JSMap, map, kMethodName);
18  JSMap::Clear(isolate, map);
19  return ReadOnlyRoots(isolate).undefined_value();
20 }
21 
22 BUILTIN(SetPrototypeClear) {
23  HandleScope scope(isolate);
24  const char* const kMethodName = "Set.prototype.clear";
25  CHECK_RECEIVER(JSSet, set, kMethodName);
26  JSSet::Clear(isolate, set);
27  return ReadOnlyRoots(isolate).undefined_value();
28 }
29 
30 } // namespace internal
31 } // namespace v8
Definition: libplatform.h:13