From 91332353e9c34d22aa79d8bd4360052cf03fc5b6 Mon Sep 17 00:00:00 2001 From: Mike Gerwitz Date: Sun, 30 Oct 2011 11:56:54 -0400 Subject: [PATCH] [#25] Added attachInstanceOf TODO --- lib/ClassBuilder.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/ClassBuilder.js b/lib/ClassBuilder.js index b7d9d58..164fd86 100644 --- a/lib/ClassBuilder.js +++ b/lib/ClassBuilder.js @@ -1065,6 +1065,9 @@ function attachInstanceOf( instance ) return module.exports.isInstanceOf( type, instance ); }; + // TODO: To improve performance (defineSecureProp can be costly), simply + // define a normal prop and freeze the class afterward. The class shouldn't + // have any mutable methods. util.defineSecureProp( instance, 'isInstanceOf', method ); util.defineSecureProp( instance, 'isA', method ); }