mirror of
https://github.com/tc39/test262.git
synced 2025-07-14 17:44:39 +02:00
Co-authored-by: Philip Chimento <pchimento@igalia.com> Co-authored-by: Ms2ger <Ms2ger@igalia.com>
26 lines
741 B
JavaScript
26 lines
741 B
JavaScript
// Copyright (C) 2023 the V8 project authors. All rights reserved.
|
|
// This code is governed by the BSD license found in the LICENSE file.
|
|
|
|
/*---
|
|
esid: sec-json.israwjson
|
|
description: Basic functionality of JSON.isRawJSON()
|
|
info: |
|
|
JSON.isRawJSON ( O )
|
|
|
|
1. If Type(O) is Object and O has an [[IsRawJSON]] internal slot, return true.
|
|
2. Return false.
|
|
|
|
features: [json-parse-with-source]
|
|
---*/
|
|
|
|
const values = [1, 1.1, null, false, true, '123'];
|
|
for (const value of values) {
|
|
assert(!JSON.isRawJSON(value));
|
|
assert(JSON.isRawJSON(JSON.rawJSON(value)));
|
|
}
|
|
assert(!JSON.isRawJSON(undefined));
|
|
assert(!JSON.isRawJSON(Symbol('123')));
|
|
assert(!JSON.isRawJSON([]));
|
|
assert(!JSON.isRawJSON({}));
|
|
assert(!JSON.isRawJSON({ rawJSON: '123' }));
|