- make with no argument will run the first rule
- run multiple tasks by spacing the task names
- for a detailed example check nodeunit Makefile
Parsing a document means translating it to a structure the code can use. The result of parsing is usually a tree of nodes that represent the structure of the document. This is called a parse tree or a syntax tree.
Parsing is based on the syntax rules the document obeys: the language or format it was written in. Every format you can parse must have deterministic grammar consisting of vocabulary and syntax rules.
Parsing can be separated into two sub processes: lexical analysis and syntax analysis.
Lexical analysis is the process of breaking the input into tokens
Tokens are the language vacabulary: the collection of valid building blocks.
thiswill not refer towindowobjectcallee,callerofargumentsobject are not allowed under strict mode- under strict mode
parameteris not refereced linked toargumentsobject, no strict mode,parameteris a reference of theargumentsobject.
(function() {
var nostrict = function(x) {
arguments[0] = 'modified';
console.log('arguments[0] =', arguments[0]);
console.log('x=', arguments[0]);
console.log('under non-strict mode,', x === arguments[0]); // log true| var constructor = function() {return null;}; | |
| var f = function f() { | |
| return constructor(); | |
| }; | |
| f(); | |
| // Under ES3 | |
| // logs {}, object literal | |
| // Under ES5 |
In computer programming, an iterator is an object that enables a programmer to traverse a container.
When invoked, generator functions return iterators
Run-to-completion scheduling is a scheduling model in which each task runs until it either finishes, or explicitly yields control back to the scheduler.
| /* | |
| * Mongoose magic | |
| */ | |
| var mongoose = require('mongoose'); | |
| mongoose.connect('mongodb://localhost:27017/fei'); | |
| var db = mongoose.connection; | |
| db.on('error', console.error.bind(console, 'connection error')); | |
| db.once('open', function() { | |
| var kittySchema = mongoose.Schema({ | |
| name: String |
| define(function() { | |
| var ScriptLoader = function(url, ns, onLoadCallback, name) { | |
| this.url = url; // url of the module | |
| this.ns = ns; // source obj/ns obj to bind 'define' method | |
| this.onLoadCallback = onLoadCallback; | |
| this.name = name; // dependency name | |
| this.load(); | |
| }; |
| # Apache | |
| ``` | |
| /etc/init.d/apache2 start/stop/restart | |
| ``` |