Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

15
LINES

< > BotCompany Repo | #1012134 // Test getting current function's name from stack trace (OK)

JavaX source code (desktop) [tags: use-pretranspiled] - run with: x30.jar

Download Jar. Libraryless. Click here for Pure Java version (878L/6K).

!7

p {
  assertEquals("main", currentFunctionName());
  test();
  print("OK");
}

svoid test {
  assertEquals("test", currentFunctionName());
}

sS currentFunctionName() {
  ret new Throwable().getStackTrace()[1].getMethodName();
}

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

-
Snippet ID: #1012134
Snippet name: Test getting current function's name from stack trace (OK)
Eternal ID of this version: #1012134/4
Text MD5: 20ea9069ecd5f09caf2fd5b03111fe30
Transpilation MD5: 41e6884d2a113c416d7dcdc3bf2bb692
Author: stefan
Category: javax
Type: JavaX source code (desktop)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-11-21 10:02:24
Source code size: 246 bytes / 15 lines
Pitched / IR pitched: No / No
Views / Downloads: 431 / 1025
Version history: 3 change(s)
Referenced in: