提交 65199644 编写于 作者: H huyunhui1

Merge branch 'master' of gitee.com:huyunhui1/xts_acts

Signed-off-by: Nhuyunhui1 <huyunhui1@huawei.com>
# Copyright (C) 2023 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import("//build/ohos_var.gni")
group("arkcompiler") {
testonly = true
if (is_standard_system) {
deps = [
"esmodule:esmodule",
]
deps = [ "esmodule:esmodule" ]
}
}
\ No newline at end of file
# Copyright (C) 2023 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import("//build/ohos_var.gni")
group("esmodule") {
......
......@@ -20,7 +20,7 @@ static napi_value Add(napi_env env, napi_callback_info info)
size_t argc = 2;
napi_value args[2] = {nullptr};
napi_get_cb_info(env, info, &argc, args , nullptr, nullptr);
napi_get_cb_info(env, info, &argc, args, nullptr, nullptr);
napi_valuetype valuetype0;
napi_typeof(env, args[0], &valuetype0);
......@@ -38,7 +38,6 @@ static napi_value Add(napi_env env, napi_callback_info info)
napi_create_double(env, value0 + value1, &sum);
return sum;
}
EXTERN_C_START
......
......@@ -12,13 +12,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {ohpmRes} from 'har'
import {ohpmRes} from 'har';
import worker from '@ohos.worker';
var workerPort = worker.workerPort;
workerPort.onmessage = function() {
console.log("ModuleTest har");
if (ohpmRes){
workerPort.postMessage("ModuleTest receive data from main thread");
let workerPort = worker.workerPort;
workerPort.onmessage = function(): void {
if (ohpmRes) {
workerPort.postMessage('ModuleTest receive data from main thread');
}
}
\ No newline at end of file
};
\ No newline at end of file
......@@ -12,13 +12,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {add} from 'libentry.so'
import {add} from 'libentry.so';
import worker from '@ohos.worker';
const ADDEND_FIRST = 2;
const ADDEND_SECOND = 3;
const SUM = 5;
var workerPort = worker.workerPort;
workerPort.onmessage = function() {
if (add(2, 3) == 5) {
console.log("ModuleTest AppNapi");
workerPort.postMessage("ModuleTest receive data from main thread");
workerPort.onmessage = function(): void {
if (add(ADDEND_FIRST, ADD_SECOND) === SUM) {
workerPort.postMessage('ModuleTest receive data from main thread');
}
}
\ No newline at end of file
};
\ No newline at end of file
......@@ -12,13 +12,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import isLeapYear from 'leap-year'
import isLeapYear from 'leap-year';
import worker from '@ohos.worker';
var workerPort = worker.workerPort;
workerPort.onmessage = function() {
if (isLeapYear(2000)){
console.log("ModuleTest ohpm");
workerPort.postMessage("ModuleTest receive data from main thread");
const LEAP_YEAR = 2000;
let workerPort = worker.workerPort;
workerPort.onmessage = function(): void {
if (isLeapYear(LEAP_YEAR)) {
workerPort.postMessage('ModuleTest receive data from main thread');
}
}
\ No newline at end of file
};
\ No newline at end of file
......@@ -12,13 +12,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { add } from '../test/test'
import { add } from '../test/test';
import worker from '@ohos.worker';
var workerPort = worker.workerPort;
workerPort.onmessage = function() {
if (add(2, 6) == 8){
console.log("ModuleTest relativePath");
workerPort.postMessage("ModuleTest receive data from main thread");
const ADDEND_FIRST = 2;
const ADDEND_SECOND = 3;
const SUM = 5;
let workerPort = worker.workerPort;
workerPort.onmessage = function(): void {
if (add(ADDEND_FIRST, ADD_SECOND) === SUM) {
workerPort.postMessage('ModuleTest receive data from main thread');
}
}
\ No newline at end of file
};
\ No newline at end of file
......@@ -12,13 +12,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import hilog from "@ohos.hilog"
import hilog from '@ohos.hilog';
import worker from '@ohos.worker';
hilog.info(0x0000, "testTag", 'dexter log: call ohos.hilog')
hilog.info(0x0000, 'testTag', 'dexter log: call ohos.hilog');
var workerPort = worker.workerPort;
workerPort.onmessage = function() {
console.log("ModuleTest systemNapi");
workerPort.postMessage("ModuleTest receive data from main thread");
}
\ No newline at end of file
let workerPort = worker.workerPort;
workerPort.onmessage = function(): void {
workerPort.postMessage('ModuleTest receive data from main thread');
};
\ No newline at end of file
......@@ -12,5 +12,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import isLeapYear from "leap-year"
export var ohpmRes = isLeapYear(2000);
\ No newline at end of file
import isLeapYear from 'leap-year';
const LEAP_YEAR = 2000;
export let ohpmRes = isLeapYear(LEAP_YEAR);
\ No newline at end of file
/**
* Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
{
"lockfileVersion": 1,
"ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.",
......
......@@ -12,5 +12,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import isLeapYear from "leap-year"
export var ohpmRes = isLeapYear(2000);
\ No newline at end of file
import isLeapYear from 'leap-year';
const LEAP_YEAR = 2000;
export let ohpmRes = isLeapYear(LEAP_YEAR);
\ No newline at end of file
/**
* Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
{
"lockfileVersion": 1,
"ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册