Closed Thread Icon

Preserved Topic: Dumping a function (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=18191" title="Pages that link to Preserved Topic: Dumping a function (Page 1 of 1)" rel="nofollow" >Preserved Topic: Dumping a function <span class="small">(Page 1 of 1)</span>\

 
InI
Paranoid (IV) Mad Scientist

From: Somewhere over the rainbow
Insane since: Mar 2001

posted posted 05-16-2002 11:01

The poster has demanded we remove all his contributions, less he takes legal action.
We have done so.
Now Tyberius Prime expects him to start complaining that we removed his 'free speech' since this message will replace all of his posts, past and future.
Don't follow his example - seek real life help first.

InI
Paranoid (IV) Mad Scientist

From: Somewhere over the rainbow
Insane since: Mar 2001

posted posted 05-16-2002 11:09

The poster has demanded we remove all his contributions, less he takes legal action.
We have done so.
Now Tyberius Prime expects him to start complaining that we removed his 'free speech' since this message will replace all of his posts, past and future.
Don't follow his example - seek real life help first.

mr.maX
Maniac (V) Mad Scientist

From: Belgrade, Serbia
Insane since: Sep 2000

posted posted 05-16-2002 11:26

Actually, the correct way (what you're doing in your example from above is creating a new anonymous function with the same contents of the function whose content you want to dump) of dumping function contents would be:

alert(FunctionName);

Note that there are no () brackets at the of function name.


InI
Paranoid (IV) Mad Scientist

From: Somewhere over the rainbow
Insane since: Mar 2001

posted posted 05-16-2002 11:30

The poster has demanded we remove all his contributions, less he takes legal action.
We have done so.
Now Tyberius Prime expects him to start complaining that we removed his 'free speech' since this message will replace all of his posts, past and future.
Don't follow his example - seek real life help first.

viol
Maniac (V) Inmate

From: Charles River
Insane since: May 2002

posted posted 05-16-2002 15:52

What is the meaning of "dumping" a function?

Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

posted posted 05-16-2002 20:04

It's getting the code that a function contains as a string.

Yossi Admon
Bipolar (III) Inmate

From: Israel
Insane since: Nov 2001

posted posted 05-19-2002 07:54

If the function name with no () brackets returns a string with the function content,
what's happens when you assign the function name to a window?
function abc(){
...
}

window.tmpFunc = abc;
It looks like it points by reference to the same function and not duplicate the function code.
It can be easily checked with 2 windows that the opener can name a local function as a reference in the child win.


Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

posted posted 05-19-2002 08:00

That's absolutely correct.

The prototype of every object, including the Function object, has a valueOf function and a toString function, which are called when the object is used where a number or string are expected. The Function object's toString function apparently returns the code that the function contains as a string.

[edit:typo]

[This message has been edited by Slime (edited 05-19-2002).]

« BackwardsOnwards »

Show Forum Drop Down Menu