提交 97c3a825 编写于 作者: fxy060608's avatar fxy060608

chore: Object.prototype.hasOwnProperty.call => hasOwn

上级 0f19e6d9
......@@ -19530,7 +19530,7 @@ function initKeyboardEvent() {
function onNodeEvent(nodeId, evt, pageNode) {
const type = evt.type;
if (type === 'onFocus' || type === 'onBlur') {
hookKeyboardEvent(evt, evt => {
hookKeyboardEvent(evt, (evt) => {
pageNode.fireEvent(nodeId, evt);
});
}
......
import { ref, computed, ExtractPropTypes, Ref, onMounted } from 'vue'
import { extend, isFunction } from '@vue/shared'
import { extend, hasOwn, isFunction } from '@vue/shared'
import type { Actions, OperateCanvasType } from '@dcloudio/uni-api'
import {
useAttrs,
......@@ -37,8 +37,8 @@ function resolveColor(color: number[]) {
function processTouches(target: EventTarget, touches: TouchEvent['touches']) {
const eventTarget = target as HTMLElement
let boundingClientRect = eventTarget.getBoundingClientRect()
return Array.from(touches).map((touch) => {
let boundingClientRect = eventTarget.getBoundingClientRect()
return {
identifier: touch.identifier,
x: touch.clientX - boundingClientRect.left,
......@@ -158,7 +158,7 @@ function useListeners(
(() => {
let obj = {}
for (const key in _$listeners) {
if (Object.prototype.hasOwnProperty.call(_$listeners, key)) {
if (hasOwn(_$listeners, key)) {
const event = (_$listeners as any)[key]
;(obj as any)[key] = event
}
......
......@@ -129,7 +129,7 @@ function processClickEvent(node: Node, triggerItemClick: Function) {
function normalizeAttrs(tagName: string, attrs: Data) {
if (!isPlainObject(attrs)) return
for (const key in attrs) {
if (Object.prototype.hasOwnProperty.call(attrs, key)) {
if (hasOwn(attrs, key)) {
const value = attrs[key]
if (tagName === 'img' && key === 'src')
attrs[key] = getRealPath(value as string)
......
......@@ -1646,8 +1646,8 @@ function resolveColor(color) {
}
function processTouches(target, touches) {
const eventTarget = target;
let boundingClientRect = eventTarget.getBoundingClientRect();
return Array.from(touches).map((touch) => {
let boundingClientRect = eventTarget.getBoundingClientRect();
return {
identifier: touch.identifier,
x: touch.clientX - boundingClientRect.left,
......@@ -1743,7 +1743,7 @@ function useListeners(props2, Listeners, trigger) {
let $listeners = shared.extend({}, (() => {
let obj = {};
for (const key in _$listeners) {
if (Object.prototype.hasOwnProperty.call(_$listeners, key)) {
if (shared.hasOwn(_$listeners, key)) {
const event = _$listeners[key];
obj[key] = event;
}
......@@ -5104,7 +5104,7 @@ function normalizeAttrs(tagName, attrs) {
if (!shared.isPlainObject(attrs))
return;
for (const key in attrs) {
if (Object.prototype.hasOwnProperty.call(attrs, key)) {
if (shared.hasOwn(attrs, key)) {
const value = attrs[key];
if (tagName === "img" && key === "src")
attrs[key] = getRealPath(value);
......
......@@ -6561,8 +6561,8 @@ function resolveColor(color) {
}
function processTouches(target, touches) {
const eventTarget = target;
let boundingClientRect = eventTarget.getBoundingClientRect();
return Array.from(touches).map((touch) => {
let boundingClientRect = eventTarget.getBoundingClientRect();
return {
identifier: touch.identifier,
x: touch.clientX - boundingClientRect.left,
......@@ -6661,7 +6661,7 @@ function useListeners(props2, Listeners, trigger) {
let $listeners = extend({}, (() => {
let obj = {};
for (const key in _$listeners) {
if (Object.prototype.hasOwnProperty.call(_$listeners, key)) {
if (hasOwn(_$listeners, key)) {
const event = _$listeners[key];
obj[key] = event;
}
......@@ -11822,7 +11822,7 @@ function normalizeAttrs(tagName, attrs2) {
if (!isPlainObject(attrs2))
return;
for (const key in attrs2) {
if (Object.prototype.hasOwnProperty.call(attrs2, key)) {
if (hasOwn(attrs2, key)) {
const value = attrs2[key];
if (tagName === "img" && key === "src")
attrs2[key] = getRealPath(value);
......@@ -15335,7 +15335,7 @@ var index$d = /* @__PURE__ */ defineBuiltInComponent({
const iframe = document.createElement("iframe");
watchEffect(() => {
for (const key in $attrs.value) {
if (Object.prototype.hasOwnProperty.call($attrs.value, key)) {
if (hasOwn($attrs.value, key)) {
const attr2 = $attrs.value[key];
iframe[key] = attr2;
}
......
......@@ -7,6 +7,7 @@ import {
watchEffect,
onBeforeUnmount,
} from 'vue'
import { hasOwn } from '@vue/shared'
import {
defineBuiltInComponent,
ResizeSensor,
......@@ -50,7 +51,7 @@ export default /*#__PURE__*/ defineBuiltInComponent({
const iframe = document.createElement('iframe')
watchEffect(() => {
for (const key in $attrs.value) {
if (Object.prototype.hasOwnProperty.call($attrs.value, key)) {
if (hasOwn($attrs.value, key)) {
const attr = ($attrs.value as any)[key]
;(iframe as any)[key] = attr
}
......
......@@ -797,8 +797,10 @@ importers:
packages/uni-uts-vite:
specifiers:
'@dcloudio/uni-cli-shared': 3.0.0-alpha-3050220220719003
'@dcloudio/uts': 3.0.0-alpha-3050220220719003
dependencies:
'@dcloudio/uni-cli-shared': link:../uni-cli-shared
'@dcloudio/uts': link:../uts
packages/uni-vue:
specifiers:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册