简体   繁体   English

从外部访问函数内的函数定义

[英]Accessing a function define within a function from outside

I have some code whose structure I cannot change. 我有一些代码,其结构无法更改。 And functions defined in such a manner. 并以这种方式定义功能。

var Something.someFunc = function(e){
    function funcTwo(){

    }
    ...
    ...
    ...
    ...
}

I need to call funcTwo from outside of this structure. 我需要从此结构外部调用funcTwo。 How do I go about doing it ? 我该怎么做呢? Someone suggested that i would have to use the".prototype" property but I cannot get this to work. 有人建议我必须使用“ .prototype”属性,但是我无法使用它。

Anyone have a suitable solution, as i cannot change the structure of the code. 任何人都有合适的解决方案,因为我无法更改代码的结构。

funcTwo is defined in someFunc scope. funcTwosomeFunc范围内定义。 There is now way for you to get access to it unless you can somehow modify the code. 除非您能以某种方式修改代码,否则现在有一种方法可以访问它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM