333
schangxiang@126.com
2025-09-19 18966e02fb573c7e2bb0c6426ed792b38b910940
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
## [2.3.0](https://github.com/power-assert-js/espower-source/releases/tag/v2.3.0) (2018-06-12)
 
 
#### Features
 
* [Support ES2018 syntax](https://github.com/power-assert-js/espower-source/pull/20)
 
 
## [2.2.0](https://github.com/power-assert-js/espower-source/releases/tag/v2.2.0) (2017-05-05)
 
 
#### Features
 
* [add `ecmaVersion` and `sourceType` to options](https://github.com/power-assert-js/espower-source/pull/17)
* [add `sourceRoot` property to generated SourceMap](https://github.com/power-assert-js/espower-source/pull/18)
 
 
## [2.1.0](https://github.com/power-assert-js/espower-source/releases/tag/v2.1.0) (2017-04-09)
 
 
#### Features
 
* [support file SourceMap](https://github.com/power-assert-js/espower-source/pull/14) by [@shepherdwind](https://github.com/shepherdwind)
 
 
### [2.0.1](https://github.com/power-assert-js/espower-source/releases/tag/v2.0.1) (2017-02-13)
 
 
#### Bug Fixes
 
* [fix: ecmaVersion 7 => 2017 to support async await](https://github.com/power-assert-js/espower-source/pull/13) by [@dead-horse](https://github.com/dead-horse)
 
 
## [2.0.0](https://github.com/power-assert-js/espower-source/releases/tag/v2.0.0) (2016-11-12)
 
 
#### Features
 
* [Integrate `empower-assert` to enable transparent assertion enhancement](https://github.com/power-assert-js/espower-source/pull/11)
* Embed value capturing helper into transpiled code (by upgrading espower to 2.0.0) ([78a57687](https://github.com/power-assert-js/espower-source/commit/78a57687b142ae99a0eae3566042a1467c016b1e))
 
 
#### Breaking Changes
 
* [Drop support for prebuilt bundle, bower, and Node v0.10](https://github.com/power-assert-js/espower-source/pull/12)
 
We stopped providing prebuilt bundle for browsers. Please build your own by using browserify, webpack and so on.
We also dropped bower support. Please use npm instead.
 
 
## [1.2.0](https://github.com/power-assert-js/espower-source/releases/tag/v1.2.0) (2016-10-25)
 
 
#### Features
 
* [show SyntaxError detail](https://github.com/power-assert-js/espower-source/pull/10) (by [@shibukawa](https://github.com/shibukawa))
 
 
## [1.1.0](https://github.com/power-assert-js/espower-source/releases/tag/v1.1.0) (2016-01-22)
 
 
#### Bug Fixes
 
* relax too strict originalCode checking ([458ef9f1](https://github.com/power-assert-js/espower-source/commit/458ef9f1e916e3496945f046bafd36497c08fe10))
 
 
#### Features
 
* [add async-await support](https://github.com/power-assert-js/espower-source/pull/8) (by [@jamestalmage](https://github.com/jamestalmage))
 
 
## [1.0.0](https://github.com/power-assert-js/espower-source/releases/tag/v1.0.0) (2015-08-08)
 
 
#### Bug Fixes
 
* properties of outgoing SourceMap is broken when `typeof options.sourceMap` is string ([af6ba419](https://github.com/power-assert-js/espower-source/commit/af6ba419fb01ee79a4fefe4c3acc23d94bd7c1b3))
* preserve sourceRoot if incoming sourceMap contains sourceRoot ([c95e3252](https://github.com/power-assert-js/espower-source/commit/c95e32520335556b41dff73c692b5a22dc105950))
 
#### Features
 
* transfer to power-assert-js organization ([ff22316e](https://github.com/power-assert-js/espower-source/commit/ff22316eb0c45bf5ec4bb91cadc13005cfd23d30))
* ship bundle for browsers with npm module ([36b4ed84](https://github.com/power-assert-js/espower-source/commit/36b4ed845048edc7749d6c0f3e61db29dfe74d21))
* [sourceRoot option](https://github.com/power-assert-js/espower-source/pull/7)
* throw EspowerError when `originalCode` is not specified ([04d86abb](https://github.com/power-assert-js/espower-source/commit/04d86abb40af1499fde55a419346666d3b90d35a))
* clarify parameter prerequisite and its outcome ([95ed841b](https://github.com/power-assert-js/espower-source/commit/95ed841bdde5bf422fa63b0680f75d4ac82b6b74))
 
 
## [0.10.0](https://github.com/power-assert-js/espower-source/releases/tag/v0.10.0) (2014-11-11)
 
 
* **espower-source:**
  * update espower to 0.10.0 ([cd05911e](https://github.com/power-assert-js/espower-source/commit/cd05911e9199ea079f8522348624387b92a97208))
 
 
### 0.9.1 (2014-09-15)
 
 
#### Features
 
* **espower-source:** update espower to 0.9.1 ([8acad23d](https://github.com/power-assert-js/espower-source/commit/8acad23d1eeb613c539ed1dba09830b86e932c0f))
 
 
## 0.9.0 (2014-08-31)
 
 
#### Features
 
* **espower-source:** backport espowerify to support multi-stage sourcemaps ([71de737c](https://github.com/power-assert-js/espower-source/commit/71de737cb16231db852a44592e896a43c447298b))
 
 
## 0.8.0 (2014-08-12)
 
 
#### Features
 
* **espower-source:**
  * update espower to 0.8.0 ([ae15a229](https://github.com/power-assert-js/espower-source/commit/ae15a229367c65a7a590104f3fb0fc0b2a7582d0))
  * simple xtend would be better for options handling ([6bea0a92](https://github.com/power-assert-js/espower-source/commit/6bea0a9241aba71f2dcae9c285561e68d91531bb))
 
 
#### Breaking Changes
 
  * update espower to 0.8.0 ([ae15a229](https://github.com/power-assert-js/espower-source/commit/ae15a229367c65a7a590104f3fb0fc0b2a7582d0))
 
If you already customize instrumentation pattern using `powerAssertVariableName` and `targetMethods`, you need to migarte. To migrate, change your code from the following:
 
```javascript
var espowerSource = require('espower-source');
var options = {
    powerAssertVariableName: 'yourAssert',
    targetMethods: {
        oneArg: [
            'okay'
        ],
        twoArgs: [
            'equal',
            'customEqual'
        ]
    }
};
var modifiedCode = espowerSource(originalCode, filepath, options);
```
 
To:
 
```javascript
var espowerSource = require('espower-source');
var options = {
    patterns: [
        'yourAssert(value, [message])',
        'yourAssert.okay(value, [message])',
        'yourAssert.equal(actual, expected, [message])',
        'yourAssert.customEqual(actual, expected, [message])'
    ]
};
var modifiedCode = espowerSource(originalCode, filepath, options);
```