| /arkcompiler/runtime_core/static_core/plugins/ets/tests/ets-templates/15.semantic_rules/04.invariance_covariance_and_contravariance/invariance/ |
| D | invariance_function.params.yaml | 18 input: 23 input: 28 input: 33 input: 38 input: 43 input: 48 input: 53 input: 58 input: 63 input: [all …]
|
| /arkcompiler/ets_frontend/ets2panda/linter/homecheck/src/utils/checker/imageFormat/ |
| D | webp.ts | 19 function calculateExtended(input: Uint8Array): ImageInfo { 21 height: 1 + readUInt24LE(input, 7), 22 width: 1 + readUInt24LE(input, 4), 26 function calculateLossLess(input: Uint8Array): ImageInfo { 28 height: 1 + (((input[4] & 0xf) << 10) | (input[3] << 2) | ((input[2] & 0xc0) >> 6)), 29 width: 1 + (((input[2] & 0x3f) << 8) | input[1]), 33 function calculateLossy(input: Uint8Array): ImageInfo { 35 height: readInt16LE(input, 8) & 0x3fff, 36 width: readInt16LE(input, 6) & 0x3fff, 41 validate(input) { [all …]
|
| D | jpg.ts | 28 function isEXIF(input: Uint8Array): boolean { 29 return toHexString(input, 2, 6) === EXIF_MARKER; 32 function extractSize(input: Uint8Array, index: number): ImageInfo { 34 height: readUInt16BE(input, index), 35 width: readUInt16BE(input, index + 2), 67 function validateExifBlock(input: Uint8Array, index: number): number | undefined { 68 const exifBlock = input.slice(APP1_DATA_SIZE_BYTES, index); 78 function validateInput(input: Uint8Array, index: number): void { 79 if (index > input.length) { 85 validate: (input) => toHexString(input, 0, 2) === 'ffd8', [all …]
|
| D | png.ts | 24 validate(input) { 25 if (pngSignature === toUTF8String(input, 1, 8)) { 26 let chunkName = toUTF8String(input, 12, 16); 28 chunkName = toUTF8String(input, 28, 32); 38 calculate(input) { 39 if (toUTF8String(input, 12, 16) === pngFriedChunkName) { 41 height: readUInt32BE(input, 36), 42 width: readUInt32BE(input, 32), 46 height: readUInt32BE(input, 20), 47 width: readUInt32BE(input, 16),
|
| /arkcompiler/runtime_core/static_core/plugins/ets/tests/ets_sdk/api/@ohos/util/ |
| D | Base64HelperTest.ets | 49 let input = new Uint8Array([72, 101, 108, 108, 111]); // "Hello" 50 let encodedStr: String = helper.encodeToStringSync(input, util.Type.BASIC); 52 assertEQ(decoded.length, input.length); 53 assertUint8ArraysEqual(decoded, input); 58 let input = new Uint8Array([87, 111, 114, 108, 100]); // "World" 59 let encodedBytes: Uint8Array = helper.encodeSync(input, util.Type.BASIC); 65 assertEQ(decoded.length, input.length); 66 assertUint8ArraysEqual(decoded, input); 71 let input = new Uint8Array([250, 251, 252, 253, 254, 255]); 72 let encodedStr: String = helper.encodeToStringSync(input, util.Type.BASIC_URL_SAFE); [all …]
|
| /arkcompiler/ets_frontend/ets2panda/linter/homecheck/src/utils/checker/ |
| D | BytesUtils.ts | 18 input: Uint8Array, 20 end = input.length 21 ): string => decoder.decode(input.slice(start, end)); 24 input: Uint8Array, 26 end = input.length 27 ): string => input.slice(start, end).reduce((memo, i) => memo + `0${i.toString(16)}`.slice(-2), ''); 30 input: Uint8Array, 32 ): DataView => new DataView(input.buffer, input.byteOffset + offset); 34 export const readInt16LE = (input: Uint8Array, offset = 0): number => 35 getView(input, offset).getInt16(0, true); [all …]
|
| D | ImageUtils.ts | 44 const input = readFileSync(filePath); constant 45 if (!input) { return undefined; } 46 const type = detector(input); 51 const size = typeHandlers[type].calculate(input, filePath); 77 const input = new Uint8Array(inputSize); constant 78 fs.readSync(descriptor, input, 0, inputSize, 0); 79 return input; 85 function detector(input: Uint8Array): imageType | undefined { 87 const byte = input[0]; 90 if (type && typeHandlers[type].validate(input)) { [all …]
|
| /arkcompiler/ets_runtime/ecmascript/compiler/baseline/ |
| D | baseline_call_signature.cpp | 43 // 4 : 4 input parameters in DEF_CALL_SIGNATURE() 47 // 4 : 4 input parameters in DEF_CALL_SIGNATURE() 59 // 4 : 4 input parameters in DEF_CALL_SIGNATURE() 63 // 4 : 4 input parameters in DEF_CALL_SIGNATURE() 75 // 3 : 3 input parameters in DEF_CALL_SIGNATURE() 79 // 3 : 3 input parameters in DEF_CALL_SIGNATURE() 90 // 4 : 4 input parameters in DEF_CALL_SIGNATURE() 94 // 4 : 4 input parameters in DEF_CALL_SIGNATURE() 106 // 1 : 1 input parameters in DEF_CALL_SIGNATURE() 110 // 1 : 1 input parameters in DEF_CALL_SIGNATURE() [all …]
|
| /arkcompiler/runtime_core/static_core/plugins/ets/tests/ets-templates/05.generics/generic_declarations/generic_functions/ |
| D | function_generic.params.yaml | 18 function processType<T>(input: T): T { 19 if (typeof input === "string") { 20 return (input as string).toUpperCase() as T; 22 return input; 30 function processType<T>(input: T): T { 31 if (typeof input === "string") { 32 return (input + "1") as T; 34 return input; 42 function processType<T>(input: T): T { 43 return input as T; [all …]
|
| D | function_generic_n.params.yaml | 18 function processType<T>(input: T): T { 19 return (input + 2) as T; 26 function processType<T>(input: T): T { 27 let output: T = input - 2; 35 function processType<T>(input: T): T { 36 let output: T = input * 2; 44 function processType<T>(input: T): T { 45 let output: T = input / 2; 53 function processType<T>(input: T): T { 54 let output: T = input % 2;
|
| /arkcompiler/runtime_core/static_core/plugins/ets/tests/stdlib-templates/escompat/ |
| D | list.escompat_regexp_instance.yaml | 20 method_signature: { input: String }, 22 method_signature_desc: { input: StringSimple }, 37 test10: { input: '"table football"' }, 38 test20: { input: '"table football"' }, 39 test30: { input: '"table football"' }, 40 test40: { input: '"table football"' }, 41 test50: { input: '"aabaac"' }, 42 test60: { input: '"ab"' }, 43 test70: { input: '"b"'}, 44 test80: { input: '"a"'}, [all …]
|
| /arkcompiler/ets_runtime/test/fuzztest/containershashmapcommon_fuzzer/ |
| D | containershashmapcommon_fuzzer.h | 81 static bool InitializeFuzzTest(const uint8_t *data, size_t size, double &input, EcmaVM *&vm, in InitializeFuzzTest() argument 100 if (memcpy_s(&input, maxByteLen, data, size) != 0) { in InitializeFuzzTest() 111 double input = 0; in ContainersHashMapEntriesFuzzTest() local 112 if (!InitializeFuzzTest(data, size, input, vm, thread)) { in ContainersHashMapEntriesFuzzTest() 120 callInfo->SetCallArg(0, JSTaggedValue(input)); in ContainersHashMapEntriesFuzzTest() 121 callInfo->SetCallArg(1, JSTaggedValue(input)); in ContainersHashMapEntriesFuzzTest() 135 double input = 0; in ContainersHashMapFuzzTest() local 136 if (!InitializeFuzzTest(data, size, input, vm, thread)) { in ContainersHashMapFuzzTest() 143 callInfo->SetCallArg(0, JSTaggedValue(input)); in ContainersHashMapFuzzTest() 152 double input = 0; in ContainersHashMapClearFuzzTest() local [all …]
|
| /arkcompiler/ets_runtime/test/perform/string/ |
| D | expect_output.txt | 17 string split number of input parameters is 2 : 70 18 string split number of input parameters is 1 : 35 20 string indexOf input parameter is a substring : 14 21 string indexOf Input parameter is not a substring : 15 22 string indexOf number of input parameters is 2 : 11 23 string slice number of input parameters is 1 : 17 24 string slice number of input parameters is 2 : 18 25 string slice input parameter is negative : 18 31 string substr number of input parameters is 2 : 17 32 string replace into string.replace searchtag in the middle of the input parameter : 59 [all …]
|
| /arkcompiler/ets_runtime/test/fuzztest/daterefnew_fuzzer/ |
| D | daterefnew_fuzzer.cpp | 32 LOG_ECMA(ERROR) << "illegal input!"; in DateRefNewFuzzTest() 35 double input = 0; in DateRefNewFuzzTest() local 39 if (memcpy_s(&input, MAXBYTELEN, data, size) != 0) { in DateRefNewFuzzTest() 43 if (std::isnan(input)) { in DateRefNewFuzzTest() 44 input = ecmascript::base::NAN_VALUE; in DateRefNewFuzzTest() 46 DateRef::New(vm, input); in DateRefNewFuzzTest() 56 LOG_ECMA(ERROR) << "illegal input!"; in DateRefGetTimeFuzzTest() 59 double input = 0; in DateRefGetTimeFuzzTest() local 63 if (memcpy_s(&input, MAXBYTELEN, data, size) != 0) { in DateRefGetTimeFuzzTest() 67 if (std::isnan(input)) { in DateRefGetTimeFuzzTest() [all …]
|
| /arkcompiler/runtime_core/static_core/plugins/ets/runtime/intrinsics/helpers/ |
| D | array_buffer_helper.cpp | 76 [[nodiscard]] bool ValidateBase64Input(std::string_view input) noexcept in ValidateBase64Input() argument 78 if (input.empty()) { in ValidateBase64Input() 81 if (input.size() % K_BASE64_BLOCK_SIZE != 0) { in ValidateBase64Input() 85 const auto paddingStart = std::find(input.begin(), input.end(), K_PADDING_CHAR); in ValidateBase64Input() 86 const bool hasPadding = paddingStart != input.end(); in ValidateBase64Input() 88 …const auto paddingCount = static_cast<size_t>(std::count(paddingStart, input.end(), K_PADDING_CHAR… in ValidateBase64Input() 90 … std::all_of(input.begin(), paddingStart, [](unsigned char c) { return IsBase64Character(c); }); in ValidateBase64Input() 93 … std::all_of(paddingStart, input.end(), [](char c) { return c == K_PADDING_CHAR; })); in ValidateBase64Input() 230 PandaVector<uint8_t> BytesFromString(std::string_view input) in BytesFromString() argument 233 bytes.assign(input.begin(), input.end()); in BytesFromString() [all …]
|
| /arkcompiler/runtime_core/static_core/plugins/ets/tests/ets_func_tests/std/core/ |
| D | StringtoLocaleUpperAndLowerCase.ets | 16 const input = ["hello", "HeLlO", "", "123!@#", "æøå", "ß"] 21 for (let i = 0;i < input.length;i++) { 22 arktest.assertEQ(input[i].toLocaleUpperCase(), outputUpper[i]); 23 arktest.assertEQ(input[i].toLocaleUpperCase("en-US"), outputUpper[i]); 24 arktest.assertEQ(input[i].toLocaleUpperCase(["en-US", "tr-TR"]), outputUpper[i]); 25 arktest.assertEQ(input[i].toLocaleUpperCase(["zh-CN", "tr-TR"]), outputUpper[i]); 26 arktest.assertEQ(input[i].toLocaleUpperCase(new Array<string>(0)), outputUpper[i]); 31 for (let i = 0;i < input.length;i++) { 32 arktest.assertEQ(input[i].toLocaleLowerCase(), outputLower[i]); 33 arktest.assertEQ(input[i].toLocaleLowerCase("en-US"), outputLower[i]); [all …]
|
| /arkcompiler/ets_frontend/ets2panda/bindings/src/ |
| D | strings.ts | 19 encode(input?: string): Uint8Array; 28 decode(input?: ArrayBuffer | null | Uint8Array, options?: WithStreamOption): string; 42 public static stringLength(input: string): int32 { 44 for (let i = 0; i < input.length; i++) { 46 let cp = input.codePointAt(i)!; 54 encodedLength(input: string): int32 { 56 for (let i = 0; i < input.length; i++) { 57 let cp = input.codePointAt(i)!; 85 encode(input: string | undefined, addLength: boolean = true): Uint8Array { 88 if (!input) { [all …]
|
| /arkcompiler/runtime_core/static_core/plugins/ets/tests/ets-templates/03.types/19.union_types/ |
| D | united_switch_ext.params.yaml | 22 function unitedSwitch(input: Animal): string { 23 switch (typeof input) { 37 function unitedSwitch(input: boolean): string { 38 switch (input) { 56 function unitedSwitch(input: Animal): string { 57 switch (typeof input) { 68 function unitedSwitch(input: number | string): string { 69 switch (input) { 79 let input = 1; 80 assertEQ(unitedSwitch(input), '1'); [all …]
|
| /arkcompiler/runtime_core/static_core/plugins/ets/sdk/api/ |
| D | @ohos.url.ets | 165 function checkCharacter(input: string) { 166 let inputLen = input.length; 168 let charPos: number = input.charCodeAt(i); 178 function deleteC0OrSpace(input: string): string { 179 if (input == "") { 183 let strLen = input.length; 187 let inputCharCode = input.charCodeAt(i); 194 let trimHead = input.substring(i); 228 function isFileNotHost(input: string) { 229 let ch = new Char(input[0]); [all …]
|
| /arkcompiler/ets_runtime/test/fuzztest/jsvaluereftobigint_fuzzer/ |
| D | jsvaluereftobigint_fuzzer.cpp | 30 LOG_ECMA(ERROR) << "illegal input!"; in JSValueRefToBigIntFuzztest() 33 char *input = new char[size](); in JSValueRefToBigIntFuzztest() local 34 if (memcpy_s(input, size, data, size) != 0) { in JSValueRefToBigIntFuzztest() 38 Local<JSValueRef> message = StringRef::NewFromUtf8(vm, input, (int)size); in JSValueRefToBigIntFuzztest() 40 delete[] input; in JSValueRefToBigIntFuzztest() 41 input = nullptr; in JSValueRefToBigIntFuzztest() 51 LOG_ECMA(ERROR) << "illegal input!"; in JSValueRefTypeofFuzztest() 54 char *input = new char[size](); in JSValueRefTypeofFuzztest() local 55 if (memcpy_s(input, size, data, size) != 0) { in JSValueRefTypeofFuzztest() 59 Local<JSValueRef> message = StringRef::NewFromUtf8(vm, input, (int)size); in JSValueRefTypeofFuzztest() [all …]
|
| /arkcompiler/ets_runtime/test/fuzztest/jsvaluerefisbig64array_fuzzer/ |
| D | jsvaluerefisbig64array_fuzzer.cpp | 32 LOG_ECMA(ERROR) << "illegal input!"; in JSValueRefIsBigInt64ArrayFuzzTest() 35 int32_t input; in JSValueRefIsBigInt64ArrayFuzzTest() local 39 if (memcpy_s(&input, MAXBYTELEN, data, size) != 0) { in JSValueRefIsBigInt64ArrayFuzzTest() 44 if (input > MaxMenory) { in JSValueRefIsBigInt64ArrayFuzzTest() 45 input = MaxMenory; in JSValueRefIsBigInt64ArrayFuzzTest() 47 Local<ArrayBufferRef> ref = ArrayBufferRef::New(vm, input); in JSValueRefIsBigInt64ArrayFuzzTest() 59 LOG_ECMA(ERROR) << "illegal input!"; in JSValueRefIsBigUint64ArrayRefNewFuzzTest() 62 int32_t input; in JSValueRefIsBigUint64ArrayRefNewFuzzTest() local 66 if (memcpy_s(&input, MAXBYTELEN, data, size) != 0) { in JSValueRefIsBigUint64ArrayRefNewFuzzTest() 71 if (input > MaxMenory) { in JSValueRefIsBigUint64ArrayRefNewFuzzTest() [all …]
|
| /arkcompiler/runtime_core/compiler/optimizer/optimizations/ |
| D | lowering.cpp | 58 // Optimize order of input arguments for decreasing using accumulator (Bytecodeoptimizer only). 84 auto input = inst->GetInput(0).GetInst(); in LowerIf() local 85 if (input->GetOpcode() != Opcode::Compare) { in LowerIf() 89 for (auto &user : input->GetUsers()) { in LowerIf() 94 // Try put constant in second input in LowerIf() 95 if (BetterToSwapCompareInputs(input)) { in LowerIf() 97 auto in0 = input->GetInput(0).GetInst(); in LowerIf() 98 auto in1 = input->GetInput(1).GetInst(); in LowerIf() 99 input->SetInput(0, in1); in LowerIf() 100 input->SetInput(1, in0); in LowerIf() [all …]
|
| /arkcompiler/ets_frontend/es2panda/ |
| D | README.md | 7 es2panda [OPTIONS] [input file] -- [arguments] 16 - `--extension`: Parse the input as the given extension (options: js | ts | as) 17 - `--module`: Parse the input as module 20 - `--parse-only`: Parse the input only 21 - `--strict`: Parse the input in strict mode 24 - `input`: input file
|
| /arkcompiler/ets_frontend/ets2panda/test/unit/lsp/ |
| D | keyword_completion_data_test.cpp | 54 std::string input = "a"; in TEST_F() local 55 ark::es2panda::lsp::Request result = ark::es2panda::lsp::KeywordCompletionData(input); in TEST_F() 68 std::string input = "as"; in TEST_F() local 71 ark::es2panda::lsp::Request result = ark::es2panda::lsp::KeywordCompletionData(input); in TEST_F() 82 std::string input = "asse"; in TEST_F() local 83 ark::es2panda::lsp::Request result = ark::es2panda::lsp::KeywordCompletionData(input); in TEST_F() 96 std::string input = "re"; in TEST_F() local 97 ark::es2panda::lsp::Request result = ark::es2panda::lsp::KeywordCompletionData(input); in TEST_F() 110 std::string input = "ret"; in TEST_F() local 111 ark::es2panda::lsp::Request result = ark::es2panda::lsp::KeywordCompletionData(input); in TEST_F() [all …]
|
| /arkcompiler/runtime_core/static_core/plugins/ets/arkts_header/ |
| D | arkts_header.cpp | 35 static bool ProcessArgs(ark::PandArgParser &paParser, const ark::PandArg<std::string> &input, in ProcessArgs() argument 38 if (input.GetValue().empty() || help.GetValue()) { in ProcessArgs() 44 …std::string outputFilename = input.GetValue().substr(0, input.GetValue().find_last_of('.')) + ".h"; in ProcessArgs() 57 ark::PandArg<std::string> input("INPUT", "", "Input binary file"); in main() local 63 paParser.PushBackTail(&input); in main() 72 if (!ProcessArgs(paParser, input, output, help)) { in main() 76 auto inputFile = ark::panda_file::File::Open(input.GetValue()); in main() 78 LOG(ERROR, ETS_NAPI) << "Cannot open file '" << input.GetValue() << "'"; in main() 86 …std::cout << "No native functions found in file '" << input.GetValue() << "', header not created" … in main()
|