首页> 外国专利> Method of Adding Local Variables In Place of Global in JavaScript

Method of Adding Local Variables In Place of Global in JavaScript

机译:在JavaScript中添加局部变量代替全局变量的方法

摘要

The present invention, in some embodiments thereof comprises a computer implemented method of detecting global variables in JavaScript code, and adding local variables in place of the global variables, comprising receiving a JavaScript code containing at least one of a plurality of globally defined functions, identifying at least one of: one or more confined global variables which receive a value within a first JavaScript scope wherein the value is not referenced outside of the first JavaScript scope, and one or more repeating global variables accessed repeatedly within a second JavaScript scope, and adding local variables in place of at least one of the confined global variables and the repeating global variables.
机译:在一些实施例中,本发明包括一种计算机实现的方法,该方法检测JavaScript代码中的全局变量,并添加局部变量来代替全局变量,包括接收包含多个全局定义函数中的至少一个的JavaScript代码,至少一个:一个或多个受约束的全局变量,它们在第一JavaScript范围内接收一个值,其中该值未在第一JavaScript范围之外被引用;以及一个或多个重复的全局变量,在第二JavaScript范围内重复访问,并添加局部变量代替约束全局变量和重复全局变量中的至少一个。

著录项

相似文献

  • 专利
  • 外文文献
  • 中文文献
获取专利

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号