mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-13 14:39:24 +02:00
pas2js: createSafeCallback: return null for null
This commit is contained in:
parent
5f757a2313
commit
1066a0dbfd
3
utils/pas2js/dist/rtl.js
vendored
3
utils/pas2js/dist/rtl.js
vendored
@ -248,6 +248,7 @@ var rtl = {
|
|||||||
createSafeCallback: function(scope, fn){
|
createSafeCallback: function(scope, fn){
|
||||||
var cb;
|
var cb;
|
||||||
if (typeof(fn)==='string'){
|
if (typeof(fn)==='string'){
|
||||||
|
if (!scope[fn]) return null;
|
||||||
if (!scope.hasOwnProperty('$events')) scope.$events = {};
|
if (!scope.hasOwnProperty('$events')) scope.$events = {};
|
||||||
cb = scope.$events[fn];
|
cb = scope.$events[fn];
|
||||||
if (cb) return cb;
|
if (cb) return cb;
|
||||||
@ -258,6 +259,8 @@ var rtl = {
|
|||||||
if (!rtl.handleUncaughtException(err)) throw err;
|
if (!rtl.handleUncaughtException(err)) throw err;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
} else if(!fn) {
|
||||||
|
return null;
|
||||||
} else {
|
} else {
|
||||||
cb = function(){
|
cb = function(){
|
||||||
try{
|
try{
|
||||||
|
Loading…
Reference in New Issue
Block a user