Phát triển Javascript - part 38 pps

Phát triển Javascript - part 38 pps

Phát triển Javascript - part 38 pps

... removing dupli- cation is the key to a flexible code base that is easy to change and mold any way we see fit. The tests are part of code base, and need constant refactoring and improve- ment too. ... directory is for third party dependencies; the other two should be self-explanatory. 14.1.1.2 Testing Framework Node has a CommonJS compliant Assert module, but in line with the low-level focus o...

Ngày tải lên: 04/07/2014, 22:20

10 192 0
Phát triển Javascript - part 3 pps

Phát triển Javascript - part 3 pps

... www.eBookTM.com ptg Part I Test-Driven Development From the Library of WoweBook.Com Download from www.eBookTM.com ptg Preface xxiii In particular, Part II focuses on JavaScript s functions and closures; JavaScript s object ... implementation of some helper utilities, which we’ll use throughout Part III. Part III: Real-World Test-Driven Development in JavaScript In this part we’...

Ngày tải lên: 04/07/2014, 22:20

10 267 0
Phát triển Javascript - part 5 ppsx

Phát triển Javascript - part 5 ppsx

... thoroughly tested, if tested at all. Test-driven development turns thedevelopment cycle upside-down.Rather than focusing on what code is required to solve a problem, test-driven development starts by defining ... be more robust. Proper test-driven development ensures that a system will never contain code that is not being executed. 2.1.2 Design in Test-Driven Development In test-driven develop...

Ngày tải lên: 04/07/2014, 22:20

10 311 0
Phát triển Javascript - part 8 ppsx

Phát triển Javascript - part 8 ppsx

... ptg 48 Tools of the Trade "test %F should act as %Y-%m-%d": function () { assertEquals("200 9-1 0-0 2", this.date.strftime("%F")); } }); The test methods ... Linux and OSX java -jar $JSTESTDRIVER_HOME/JsTestDriver-1.2.1.jar tests all Listing 3.11 Running tests with JsTestDriver on Windows java -jar %JSTESTDRIVER_HOME%\JsTestDriver-1.2.1.jar tests all The ......

Ngày tải lên: 04/07/2014, 22:20

10 333 0
Phát triển Javascript - part 10 pps

Phát triển Javascript - part 10 pps

... testing. In Part II, JavaScript for Programmers, we will take a deep dive into JavaScript, specifically focusing on aspects of the language that sets it apart from other programming lan- guages. ... code in environments without a DOM, such as server-side JavaScript runtimes. 4.2.2 Profiling and Locating Bottlenecks Firebug, the web developer add-on for Firefox, offers a profiler that can...

Ngày tải lên: 04/07/2014, 22:20

10 275 0
Phát triển Javascript - part 12 pps

Phát triển Javascript - part 12 pps

... the one presented in Listing 5.8. The ECMAScript specification specifically calls for many built-in meth- ods to be generic, allowing them to be used with other objects that exhibit the right qualities. ... function with the first ar- gument as this. Additional arguments are passed to the function when calling it. The first example of addToArray in Listing 5.8 used this method call Ar- ray.protot...

Ngày tải lên: 04/07/2014, 22:20

10 235 0
Phát triển Javascript - part 14 ppsx

Phát triển Javascript - part 14 ppsx

... The interesting parts are the collection, index and length free variables. The iterator function re- turns an object whose methods have access to the free variables, and is an imple- mentation of ... (x < 2) { return 1; } return fibonacci(x - 1) + fibonacci(x - 2); } The Fibonacci sequence is very expensive, and quickly spawns too many recur- sive calls for a browser to handle. By...

Ngày tải lên: 04/07/2014, 22:20

10 243 0
Phát triển Javascript - part 15 pps

Phát triển Javascript - part 15 pps

... However, unlike most other object oriented languages, JavaScript does not have classes. Instead, JavaScript offers prototypes and prototype-based inheritance in which objects inherit from other objects. ... chain. The prototype chain is used to share properties across objects in JavaScript, and forms the basis for JavaScript s inheri- tance model. This concept is fundamentally different...

Ngày tải lên: 04/07/2014, 22:20

10 298 0
Phát triển Javascript - part 28 pps

Phát triển Javascript - part 28 pps

... Msxml2.XMLHTTP.6.0 installed side-by-side with Msxml2.XMLHTTP.3.0 (which comes with IE 6). This means that ei- ther Msxml2.XMLHTTP.6.0 or Microsoft.XMLHTTP is sufficient to re- trieve the newest available ... request_test.js Listing 12.2 The jsTestDriver.conf file server: http://localhost:4224 load: - lib/*.js - src/*.js - test/*.js From the Library of WoweBook.Com Download from ww...

Ngày tải lên: 04/07/2014, 22:20

10 215 0
Phát triển Javascript - part 30 pps

Phát triển Javascript - part 30 pps

... PUBLIC " ;-/ /W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html lang="en"> <head> <meta http-equiv="content-type" content="text/html; ... type="text /javascript& quot; src=" /lib/tdd.js"></script> <script type="text /javascript& quot; src=" /src/ajax.js"></scrip...

Ngày tải lên: 04/07/2014, 22:20

10 283 0
w