Skip to content

Commit 6887404

Browse files
committed
Update F.script() functionality.
1 parent f03efc5 commit 6887404

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

changes.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
- updated: `U.streamer(beg, [end], function, [skip])` add a new argument `skip`
2626
- updated: deprecated methods in Node.js v7
2727
- updated: `String.parseJSON([date])` added `date` argument (date fields will be converted to `datetime`)
28-
- updated: `F.script()` can compile code to function e.g.: `F.script('next(a + b)', true)` returns a compiled function
28+
- updated: `F.script()` can compile code to function e.g.: `F.script('next(a + b)')` returns a compiled function
2929

3030
- removed: behaviours
3131
- removed: restrictions

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -934,7 +934,7 @@ Framework.prototype.$routesSort = function(type) {
934934
Framework.prototype.script = function(body, value, callback) {
935935

936936
var fn;
937-
var compilation = value === true && callback === undefined;
937+
var compilation = value === undefined && callback === undefined;
938938

939939
try {
940940
fn = new Function('next', 'value', 'now', 'var model=value;var global,require,process,GLOBAL,root,clearImmediate,clearInterval,clearTimeout,setImmediate,setInterval,setTimeout,console,$STRING,$VIEWCACHE,framework_internal,TransformBuilder,Pagination,Page,URLBuilder,UrlBuilder,SchemaBuilder,framework_builders,framework_utils,framework_mail,Image,framework_image,framework_nosql,Builders,U,utils,Utils,Mail,WTF,SOURCE,INCLUDE,MODULE,NOSQL,NOBIN,NOCOUNTER,NOSQLMEMORY,NOMEM,DATABASE,DB,CONFIG,INSTALL,UNINSTALL,RESOURCE,TRANSLATOR,LOG,LOGGER,MODEL,GETSCHEMA,CREATE,UID,TRANSFORM,MAKE,SINGLETON,NEWTRANSFORM,NEWSCHEMA,EACHSCHEMA,FUNCTION,ROUTING,SCHEDULE,OBSOLETE,DEBUG,TEST,RELEASE,is_client,is_server,F,framework,Controller,setTimeout2,clearTimeout2,String,Number,Boolean,Object,Function,Date,isomorphic,I,eval;UPTODATE;try{' + body + '}catch(e){next(e)}');

0 commit comments

Comments
 (0)