码迷,mamicode.com
首页 > Web开发 > 详细

js预编译规则

时间:2017-12-28 23:24:41      阅读:260      评论:0      收藏:0      [点我收藏+]

标签:nbsp   test   对象   div   预编译   on()   属性   style   变量   

1.创建一个AO对象

2.找形参、变量声明,把形参、变量声明的名作为AO对象的属性名,值为undefined

3.实参形参相统一,即把与形参相对应的实参的值赋给AO对象中相应的属性

4.找函数声明,把函数声明的名作为AO对象的属性名,把整个函数块赋给对应的属性

function test(a,b) {
    console.log(a)
    c=0;
    var c;
    a=3;
    b=2;
    console.log(b);
    function b() {};
    function d() {};
    console,log(b);
}

test(1)                 //1,2,2

1.AO{

}

2.AO{
a:undefined,
b:undefined,
c:undefined,
}

3.AO{
a:1,
b:undefined,
c:undefined,
}

4.AO{
a:1,
b:function() b{},
c:undefined,
d:function() d{}
}

 

js预编译规则

标签:nbsp   test   对象   div   预编译   on()   属性   style   变量   

原文地址:https://www.cnblogs.com/skyeming/p/8137934.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!