• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Copyright JS Foundation and other contributors, http://js.foundation
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15try {
16  Object.getOwnPropertyNames("hello");
17  assert (false);
18} catch (e) {
19  assert (e instanceof TypeError);
20}
21
22try
23{
24  Object.preventExtensions(42);
25  assert (false);
26} catch (e) {
27  assert (e instanceof TypeError);
28}
29
30try
31{
32  Object.isExtensible(42);
33  assert (false);
34} catch (e) {
35  assert (e instanceof TypeError);
36}
37
38try
39{
40  Object.seal(42);
41  assert (false);
42} catch (e) {
43  assert (e instanceof TypeError);
44}
45
46try
47{
48  Object.isSealed(42);
49  assert (false);
50} catch (e) {
51  assert (e instanceof TypeError);
52}
53
54try
55{
56  Object.freeze(42);
57  assert (false);
58} catch (e) {
59  assert (e instanceof TypeError);
60}
61
62try
63{
64  Object.isFrozen(42);
65  assert (false);
66} catch (e) {
67  assert (e instanceof TypeError);
68}
69
70try {
71  Object.keys("hello");
72  assert (false);
73} catch (e) {
74  assert (e instanceof TypeError);
75}
76
77try {
78  Object.getOwnPropertyNames("hello");
79  assert (false);
80} catch (e) {
81  assert (e instanceof TypeError);
82}
83
84try {
85  Object.getOwnPropertyDescriptor("hello", '1');
86  assert (false);
87} catch (e) {
88  assert (e instanceof TypeError);
89}
90