json-value-string.js 721 B

1234567891011121314151617181920
  1. // Copyright (C) 2021 the V8 project authors. All rights reserved.
  2. // This code is governed by the BSD license found in the LICENSE file.
  3. /*---
  4. esid: sec-parse-json-module
  5. description: Correctly parses the JSON representation of a string
  6. info: |
  7. # 1.4 ParseJSONModule ( source )
  8. The abstract operation ParseJSONModule takes a single argument source which
  9. is a String representing the contents of a module.
  10. 1. Let json be ? Call(%JSON.parse%, undefined, « source »).
  11. 2. Return CreateDefaultExportSyntheticModule(json).
  12. flags: [module]
  13. features: [import-assertions, json-modules]
  14. ---*/
  15. import value from './json-value-string_FIXTURE.json' assert { type: 'json' };
  16. assert.sameValue(value, 'a string value');