Created
August 1, 2015 09:28
-
-
Save LeonardoCiaccio/3ca8b65f3408c9d25a78 to your computer and use it in GitHub Desktop.
Suppress an error like "@" in PHP
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| at = function( test ){ | |
| try{ | |
| if( typeof test === "function" )return test(); | |
| return test || null; | |
| }catch( e ){ | |
| return null; | |
| } | |
| }; | |
| /* | |
| var test = at( function(){ | |
| throw new Error( "test is null without error" ); | |
| } ); | |
| */ | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment