summaryrefslogtreecommitdiff
path: root/deps/v8/src/builtins/builtins-collections.cc
blob: e3c97d38413336df6c477f5677e3547e12cb93df (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// Copyright 2016 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "src/builtins/builtins-utils.h"
#include "src/builtins/builtins.h"
#include "src/objects-inl.h"

namespace v8 {
namespace internal {

BUILTIN(MapPrototypeClear) {
  HandleScope scope(isolate);
  const char* const kMethodName = "Map.prototype.clear";
  CHECK_RECEIVER(JSMap, map, kMethodName);
  JSMap::Clear(map);
  return isolate->heap()->undefined_value();
}

BUILTIN(SetPrototypeClear) {
  HandleScope scope(isolate);
  const char* const kMethodName = "Set.prototype.clear";
  CHECK_RECEIVER(JSSet, set, kMethodName);
  JSSet::Clear(set);
  return isolate->heap()->undefined_value();
}

}  // namespace internal
}  // namespace v8