- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我试图通过使用 arguments.callee.caller
找出调用我的 Google Apps 脚本函数的函数的名称。如 How do you find out the caller function in JavaScript? ,但似乎没有导出这样的属性。 (但是,arguments.callee
存在。)
如何在 Google Apps 脚本中获取该调用函数的名称?
作为次要问题,为什么不是 arguments.callee.caller
那里?
最佳答案
我做了这个功能:
function getCaller()
{
var stack;
var ret = "";
try
{
throw new Error("Whoops!");
}
catch (e)
{
stack = e.stack;
}
finally
{
var matchArr = stack.match(/\(.*\)/g);
if (matchArr.length > 2)
{
tmp = matchArr[2];
ret = tmp.slice(1, tmp.length - 1) + "()";
}
return ret;
}
}
关于google-apps-script - 如何获取arguments.callee.caller?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14713292/
如果在主编辑器中突出显示功能名称,然后在助手编辑器中选择“调用者”,则可以查看突出显示的功能的调用位置。 助手编辑器顶部有向左和向右箭头,可让您跳至调用该函数的上一个/下一个位置。这些有键盘快捷键吗?
在 JupyterLab 上使用以下代码来运行 Google Video Intelligence Package: from google.cloud import videointelligenc
我有以下代码: Set b = ActiveSheet.Buttons(Application.Caller) With b.TopLeftCell bcn = .Column brn
我在一个子例程中使用 Application.Caller,我以编程方式将其绑定(bind)到我在工作表上找到的所有形状的 OnAction 属性。 Application.Caller 返回启动调用
我有下面的代码,它根据运行的位置打印不同的程序计数器值。 代码: package main import ( "fmt" "runtime" ) func foo() { ba
我在 VBA 中有以下代码: Sub Kontrollkästchen_KlickenSieAuf() With ThisWorkbook.Sheets("Hinterlegungsmatrix Au
通读 Effective Go 文档,我有点难以理解以下语句的含义。 If you pass a map to a function that changes the contents of the
我使用的是 Google Sheets API v4。 我已经用一些工作表进行了测试,我的代码可以正常工作,但有些则不行。我所做的只是换出工作表 ID。 我使用在这里找到的代码: https://de
两部分问题: 如何从对象方法获取function.caller。 如何使用该值来实际调用函数。 示例: foo = { bar: function() {console.log(bar.cal
批处理文件子例程的 return 语句等效于什么? 最佳答案 它是: goto :eof 对于习惯于普通编程语言的人来说,这是不寻常的,这是可以理解的。 我找到了这个信息 here . 关于windo
我想在与 WCF 服务通信时使用基于证书的加密和验证。所以我创建了测试证书,“TempCA”作为我的根 CA,“SignedByCA”作为由该 CA 签署的客户端证书。 当我将客户端证书放在“本地计算
我正在尝试以编程方式更新我的一个项目的结算帐户。我正在为 googleapis REST 使用 Node 客户端库。这是我的代码: const { google } = require('google
我最近注意到,在使用赋值的大多数情况下,重新初始化动态变量没有我预期的语义(但是,绑定(bind)以我预期的方式工作)。 具体来说,在这段代码中: sub g { my $*i = CALL
想象一下这种情况: Activity_1: get Activity_2 started with startActivityForResult; Activity_2: get Activity_3
间歇性地收到此错误 HttpError 403 when requesting https://www.googleapis.com/discovery/v1/apis/gmail/v1/rest r
我还没有在一页中清楚地看到这一点:部分受信任的调用者。 我正在研究 APTCA,这总是被提及,但 MSDN 没有关于它的文章。 我只有一些线索,但我不是 100% 确定。 从网络共享执行的代码是否符合
我正在尝试从客户端控制台应用程序访问服务器上的 WCF 服务进行测试。我收到以下错误: The caller was not authenticated by the service 我正在使用wsH
当特定函数被调用两次时,我想看到 Angular 堆栈跟踪,这看起来很奇怪,但却是预期的行为 https://github.com/angular/angular.js/issues/1146 。 u
我有一些 jQuery 代码。我调用了一个 Ajax 函数文件 file.php,它有一些字段,例如: Milk. 我会再次分配给 jQuery 函数吗?如果是这样,我该怎么做?我附上了一个示例文件:
只是一些琐事;我在循环中创建 View 和模型,然后尝试将自定义事件绑定(bind)到它们。到目前为止一切都很好,但是当我想找出对象触发事件时呢?我知道还有其他冗长的方法可以将事件单独分配给系列中的每
我是一名优秀的程序员,十分优秀!