Modify code security specification alarm

Issue: https://gitee.com/openharmony/arkcompiler_ets_runtime/issues/IAZA48?from=project-issue

Signed-off-by: yy <yejunwen2@h-partners.com>
This commit is contained in:
yy 2024-10-23 16:46:56 +08:00
parent 8a2f165ee3
commit c2ac0c39b2
7 changed files with 19 additions and 19 deletions

View File

@ -18,14 +18,14 @@ import { X2DFast } from './graphics/X2DFast.js';
import { Scr } from './XDefine.js';
import { XTools } from './XTools.js';
export var gl;
var Mouse = {
export let gl;
const Mouse = {
MOUSE_LEFT: 0,
MOUSE_RILLER: 1,
MOUSE_RIGHT: 2,
};
var MouseEvent = {
const MouseEvent = {
LEFT_CLICK: 1,
LEFT_MOVE: 2,
LEFT_RELEASE: 3,

View File

@ -31,7 +31,7 @@ export class Scr {
Scr.height = h;
if ('undefined' != typeof wx) {
var info = wx.getSystemInfoSync();
let info = wx.getSystemInfoSync();
Scr.width = info.windowWidth;
Scr.height = info.windowHeight;
}

View File

@ -60,7 +60,7 @@ export function iDistance(x, y) {
return Math.sqrt(x * x + y * y);
}
export var timeMs = 0;
export let timeMs = 0;
export function freshTime() {
let t = new Date();
timeMs = t.getTime();

View File

@ -177,4 +177,4 @@ export class XMat4 {
}
}
var tmpmat = new XMat4();
let tmpmat = new XMat4();

View File

@ -73,7 +73,7 @@ export class XShader {
return this.pUseingShader;
}
initShader(vss, fss) {
var vs = gl.createShader(gl.VERTEX_SHADER);
let vs = gl.createShader(gl.VERTEX_SHADER);
gl.shaderSource(vs, vss);
gl.compileShader(vs);
if (!gl.getShaderParameter(vs, gl.COMPILE_STATUS)) {
@ -83,7 +83,7 @@ export class XShader {
return null;
}
var fs = gl.createShader(gl.FRAGMENT_SHADER);
let fs = gl.createShader(gl.FRAGMENT_SHADER);
gl.shaderSource(fs, fss);
gl.compileShader(fs);
if (!gl.getShaderParameter(fs, gl.COMPILE_STATUS)) {
@ -93,7 +93,7 @@ export class XShader {
return null;
}
var ret = gl.createProgram();
let ret = gl.createProgram();
gl.attachShader(ret, vs);
gl.attachShader(ret, fs);

View File

@ -50,9 +50,9 @@ export class XTexture {
}
loadTextureFromImage(path, keepdata = false) {
if (path === 'CUSTOM_TEXTURE_1') {
var rid = this.ximages.length;
let rid = this.ximages.length;
var texture = gl.createTexture();
let texture = gl.createTexture();
XTexture.initTextureStatus(texture);
let tmp = new Uint8Array([255, 255, 255, 255]);
@ -76,12 +76,12 @@ export class XTexture {
return i;
}
}
var rid = this.ximages.length;
let rid = this.ximages.length;
this.ximages[rid] = { stat: 0, path: path, tex: null };
var image = new Image();
let image = new Image();
image.src = path; //"http://localhost:8910/"+
image.onload = function () {
var texture = gl.createTexture();
let texture = gl.createTexture();
XTexture.initTextureStatus(texture);
gl.texImage2D(
@ -154,15 +154,15 @@ export class XTexture {
}
PutTexture(tex, w, h) {
var rid = this.ximages.length;
let rid = this.ximages.length;
this.ximages[rid] = { stat: 1, path: 'put' + rid, tex: tex, w: w, h: h };
return rid;
}
loadTexture(width, height) {
var rid = this.ximages.length;
let rid = this.ximages.length;
var texture = gl.createTexture();
let texture = gl.createTexture();
XTexture.initTextureStatus(texture);
gl.texImage2D(
gl.TEXTURE_2D,

View File

@ -13,7 +13,7 @@
* limitations under the License.
*/
var shaderFastVs = `
const shaderFastVs = `
attribute vec3 position;
attribute vec2 aTexCoord;
attribute vec4 ext1;//x,y,sw,sh,
@ -55,7 +55,7 @@ void main()
}
`;
var shaderFastFs = `
const shaderFastFs = `
precision mediump float;
varying vec2 TexCoord;