In line (B), Grab()-method of (A)-object is executed, after accepting an argument
new sg.SelectionTarget().
With this "new" keyword, another object is created. Is that another sg instance, or another SelectionTarget() member function in the same sg object?
In line (C), another object is created. If the answer of the first question is "sg instance", what does it mean the "screengrab"-variable between"(" and "." in line(C); sg instance newly created in line(C) or sg object initially created in line(A)?
// objects
var screengrab = {};
var sg = screengrab;//-----(A)
screengrab.Grab = function(target) {
try {
// (some code)
} catch (error) {
// (some code)
}
}
screengrab.SelectionTarget = function() {
this.contentBrowser = new screengrab.Browser(screengrab
.Browser.contentWindow());------(C)
}
screengrab.Browser = function(win) {
this.win = win;
this.doc = new screengrab.Document(win.document);
this.htmlDoc = win.document;
this.htmlWin = win.content.window;
}
screengrab.Browser.contentWindow = function() {
return window.top.getBrowser().selectedBrowser.contentWindow;
}
// After User's action, this function triggers.
sg.Grab(new sg.SelectionTarget());------(B)