File tree Expand file tree Collapse file tree 4 files changed +9
-9
lines changed
1-js/06-advanced-functions/09-call-apply-decorators
10-regular-expressions/08-regexp-greedy-and-lazy Expand file tree Collapse file tree 4 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -106,7 +106,7 @@ alert( worker.slow(1) ); // the original method works
106106worker .slow = cachingDecorator (worker .slow ); // now make it caching
107107
108108* ! *
109- alert ( worker .slow (2 ) ); // WOOPS ! Error: Cannot read property 'someMethod' of undefined
109+ alert ( worker .slow (2 ) ); // Whoops ! Error: Cannot read property 'someMethod' of undefined
110110*/ ! *
111111```
112112
Original file line number Diff line number Diff line change @@ -218,7 +218,7 @@ alert( str.match(reg) ); // <a href="link" class="doc">
218218let str = ' ...<a href="link1" class="doc">... <a href="link2" class="doc">...' ;
219219let reg = / <a href=". * " class="doc">/ g ;
220220
221- // Woops ! Two links in one match!
221+ // Whoops ! Two links in one match!
222222alert ( str .match (reg) ); // <a href="link1" class="doc">... <a href="link2" class="doc">
223223```
224224
Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ Or, in case of an error:
4444``` js
4545let promise = new Promise (function (resolve , * ! * reject */ ! * ) {
4646 // after 1 second signal that the job is finished with an error
47- setTimeout (() => reject (new Error (" Woops !" )), 1000 );
47+ setTimeout (() => reject (new Error (" Whoops !" )), 1000 );
4848});
4949```
5050
@@ -82,10 +82,10 @@ promise.then(result => alert(result));
8282
8383``` js run
8484let promise = new Promise (function (resolve , reject ) {
85- setTimeout (() => reject (new Error (" Woops !" )), 1000 );
85+ setTimeout (() => reject (new Error (" Whoops !" )), 1000 );
8686});
8787
88- // shows "Woops !" after 1 second
88+ // shows "Whoops !" after 1 second
8989promise .catch (error => alert (error .message ));
9090```
9191
Original file line number Diff line number Diff line change @@ -212,9 +212,9 @@ For instance:
212212
213213``` js run
214214new Promise (function (resolve , reject ) {
215- throw new Error (" Woops !" );
215+ throw new Error (" Whoops !" );
216216}).catch (function (error ) {
217- alert (error .message ); // Whoops
217+ alert (error .message ); // Whoops!
218218});
219219
220220## Inheriting from promise, thenables, error handling?
@@ -248,11 +248,11 @@ new Promise(function(resolve, reject) {
248248 setTimeout(() => resolve(1), 1000);
249249}).then(function(result) {
250250
251- throw new Error("Woops !");
251+ throw new Error("Whoops !");
252252
253253}).catch(function(error) {
254254
255- alert(error.message); // Woops !
255+ alert(error.message); // Whoops !
256256
257257});
258258` ` `
You can’t perform that action at this time.
0 commit comments