* Generate a static keys string from compiler modules. * * [{ staticKeys:1},{staticKeys:2},{staticKeys:3}] * 连接数组对象中的 staticKeys key值,连接成一个字符串 str=‘1,2,3’
(modules)
| 408 | * 连接数组对象中的 staticKeys key值,连接成一个字符串 str=‘1,2,3’ |
| 409 | */ |
| 410 | function genStaticKeys(modules) { |
| 411 | return modules.reduce( |
| 412 | function (keys, m) { |
| 413 | //累加staticKeys的值变成数组 |
| 414 | return keys.concat(m.staticKeys || []) |
| 415 | }, |
| 416 | [] |
| 417 | ).join(',') //转换成字符串 |
| 418 | } |
| 419 | |
| 420 | /** |
| 421 | * Check if two values are loosely equal - that is, |