js/src/jsapi-tests/testFunctionProperties.cpp
author Mozilla Releng Treescript <release+treescript@mozilla.org>
Tue, 28 Jun 2022 19:14:40 +0000
changeset 622284 8e99b54b620b9100f2c9f113b2ed46271e41d3bc
parent 585399 3a72f69192c6d75dea48034e554c3a9bf4f58055
permissions -rw-r--r--
no bug - Bumping Firefox l10n changesets r=release a=l10n-bump DONTBUILD be -> eb2b08c1435a3577605ac3c821b2450968a6f6cb he -> 5660274011fe5e85fdc42b47b503cdfdb9598478 ia -> ae0f01fb5b7982c1b84cd00b2da21f6bfd9583f8 it -> 337e2d7d008e01f3d233527a7a76b8955dd1602f nn-NO -> aee623f3aa8c88e409851d1ecb42bd1b1e24b986 oc -> 80114c189f5a11fe8ef641ec3b965659618d4a04 ru -> 22416553f0282f7055d5a11cd12e5ce39e66c88d tg -> 6db775921d2d2d4649b7de4241d548ebfb2a4771 tl -> d1bf362357e8fa87f9a426f948dcb5409e3b797a vi -> 9c203d3ebb39f7c339fd3d61690f748416cc7404 zh-CN -> feaf1e52f2b36b210c29f55d53faebf373bdd2f0 zh-TW -> fd1e717e8be4e824abcafb8f266047810c44e4a5

/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
 * vim: set ts=8 sts=2 et sw=2 tw=80:
 */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#include "js/PropertyAndElement.h"  // JS_GetProperty
#include "jsapi-tests/tests.h"

BEGIN_TEST(testFunctionProperties) {
  JS::RootedValue x(cx);
  EVAL("(function f() {})", &x);

  JS::RootedObject obj(cx, x.toObjectOrNull());

  JS::RootedValue y(cx);
  CHECK(JS_GetProperty(cx, obj, "arguments", &y));
  CHECK(y.isNull());

  CHECK(JS_GetProperty(cx, obj, "caller", &y));
  CHECK(y.isNull());

  return true;
}
END_TEST(testFunctionProperties)