11cb0ef41Sopenharmony_ci// Flags: --experimental-loader ./test/fixtures/es-module-loaders/string-sources.mjs 21cb0ef41Sopenharmony_ciimport { mustCall, mustNotCall } from '../common/index.mjs'; 31cb0ef41Sopenharmony_ciimport assert from 'assert'; 41cb0ef41Sopenharmony_ci 51cb0ef41Sopenharmony_ciimport('test:Array').then( 61cb0ef41Sopenharmony_ci mustNotCall('Should not accept Arrays'), 71cb0ef41Sopenharmony_ci mustCall((e) => { 81cb0ef41Sopenharmony_ci assert.strictEqual(e.code, 'ERR_INVALID_RETURN_PROPERTY_VALUE'); 91cb0ef41Sopenharmony_ci }) 101cb0ef41Sopenharmony_ci); 111cb0ef41Sopenharmony_ciimport('test:ArrayBuffer').then( 121cb0ef41Sopenharmony_ci mustCall(), 131cb0ef41Sopenharmony_ci mustNotCall('Should accept ArrayBuffers'), 141cb0ef41Sopenharmony_ci); 151cb0ef41Sopenharmony_ciimport('test:BigInt64Array').then( 161cb0ef41Sopenharmony_ci mustCall(), 171cb0ef41Sopenharmony_ci mustNotCall('Should accept BigInt64Array'), 181cb0ef41Sopenharmony_ci); 191cb0ef41Sopenharmony_ciimport('test:BigUint64Array').then( 201cb0ef41Sopenharmony_ci mustCall(), 211cb0ef41Sopenharmony_ci mustNotCall('Should accept BigUint64Array'), 221cb0ef41Sopenharmony_ci); 231cb0ef41Sopenharmony_ciimport('test:Float32Array').then( 241cb0ef41Sopenharmony_ci mustCall(), 251cb0ef41Sopenharmony_ci mustNotCall('Should accept Float32Array'), 261cb0ef41Sopenharmony_ci); 271cb0ef41Sopenharmony_ciimport('test:Float64Array').then( 281cb0ef41Sopenharmony_ci mustCall(), 291cb0ef41Sopenharmony_ci mustNotCall('Should accept Float64Array'), 301cb0ef41Sopenharmony_ci); 311cb0ef41Sopenharmony_ciimport('test:Int8Array').then( 321cb0ef41Sopenharmony_ci mustCall(), 331cb0ef41Sopenharmony_ci mustNotCall('Should accept Int8Array'), 341cb0ef41Sopenharmony_ci); 351cb0ef41Sopenharmony_ciimport('test:Int16Array').then( 361cb0ef41Sopenharmony_ci mustCall(), 371cb0ef41Sopenharmony_ci mustNotCall('Should accept Int16Array'), 381cb0ef41Sopenharmony_ci); 391cb0ef41Sopenharmony_ciimport('test:Int32Array').then( 401cb0ef41Sopenharmony_ci mustCall(), 411cb0ef41Sopenharmony_ci mustNotCall('Should accept Int32Array'), 421cb0ef41Sopenharmony_ci); 431cb0ef41Sopenharmony_ciimport('test:null').then( 441cb0ef41Sopenharmony_ci mustNotCall('Should not accept null'), 451cb0ef41Sopenharmony_ci mustCall((e) => { 461cb0ef41Sopenharmony_ci assert.strictEqual(e.code, 'ERR_INVALID_RETURN_PROPERTY_VALUE'); 471cb0ef41Sopenharmony_ci }) 481cb0ef41Sopenharmony_ci); 491cb0ef41Sopenharmony_ciimport('test:Object').then( 501cb0ef41Sopenharmony_ci mustNotCall('Should not stringify or valueOf Objects'), 511cb0ef41Sopenharmony_ci mustCall((e) => { 521cb0ef41Sopenharmony_ci assert.strictEqual(e.code, 'ERR_INVALID_RETURN_PROPERTY_VALUE'); 531cb0ef41Sopenharmony_ci }) 541cb0ef41Sopenharmony_ci); 551cb0ef41Sopenharmony_ciimport('test:SharedArrayBuffer').then( 561cb0ef41Sopenharmony_ci mustCall(), 571cb0ef41Sopenharmony_ci mustNotCall('Should accept SharedArrayBuffers'), 581cb0ef41Sopenharmony_ci); 591cb0ef41Sopenharmony_ciimport('test:string').then( 601cb0ef41Sopenharmony_ci mustCall(), 611cb0ef41Sopenharmony_ci mustNotCall('Should accept strings'), 621cb0ef41Sopenharmony_ci); 631cb0ef41Sopenharmony_ciimport('test:String').then( 641cb0ef41Sopenharmony_ci mustNotCall('Should not accept wrapper Strings'), 651cb0ef41Sopenharmony_ci mustCall((e) => { 661cb0ef41Sopenharmony_ci assert.strictEqual(e.code, 'ERR_INVALID_RETURN_PROPERTY_VALUE'); 671cb0ef41Sopenharmony_ci }) 681cb0ef41Sopenharmony_ci); 691cb0ef41Sopenharmony_ciimport('test:Uint8ClampedArray').then( 701cb0ef41Sopenharmony_ci mustCall(), 711cb0ef41Sopenharmony_ci mustNotCall('Should accept Uint8ClampedArray'), 721cb0ef41Sopenharmony_ci); 731cb0ef41Sopenharmony_ciimport('test:Uint16Array').then( 741cb0ef41Sopenharmony_ci mustCall(), 751cb0ef41Sopenharmony_ci mustNotCall('Should accept Uint16Array'), 761cb0ef41Sopenharmony_ci); 771cb0ef41Sopenharmony_ciimport('test:Uint32Array').then( 781cb0ef41Sopenharmony_ci mustCall(), 791cb0ef41Sopenharmony_ci mustNotCall('Should accept Uint32Array'), 801cb0ef41Sopenharmony_ci); 811cb0ef41Sopenharmony_ciimport('test:Uint8Array').then( 821cb0ef41Sopenharmony_ci mustCall(), 831cb0ef41Sopenharmony_ci mustNotCall('Should accept Uint8Arrays'), 841cb0ef41Sopenharmony_ci); 851cb0ef41Sopenharmony_ciimport('test:undefined').then( 861cb0ef41Sopenharmony_ci mustNotCall('Should not accept undefined'), 871cb0ef41Sopenharmony_ci mustCall((e) => { 881cb0ef41Sopenharmony_ci assert.strictEqual(e.code, 'ERR_INVALID_RETURN_PROPERTY_VALUE'); 891cb0ef41Sopenharmony_ci }) 901cb0ef41Sopenharmony_ci); 91