Skip to content

Commit

Permalink
Fixed context bug for complex JS expressions
Browse files Browse the repository at this point in the history
  • Loading branch information
gliechtenstein committed Feb 3, 2017
1 parent 4062d88 commit 1ce810c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions app/Jasonette.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

/* Begin PBXBuildFile section */
045E5F3D1E3661060088D5E6 /* JasonReturnAction.m in Sources */ = {isa = PBXBuildFile; fileRef = 045E5F3C1E3661060088D5E6 /* JasonReturnAction.m */; };
045E5F561E42BBDB0088D5E6 /* parser.js in Resources */ = {isa = PBXBuildFile; fileRef = 045E5F551E42BBDB0088D5E6 /* parser.js */; };
045E5F581E44E5180088D5E6 /* parser.js in Resources */ = {isa = PBXBuildFile; fileRef = 045E5F571E44E5180088D5E6 /* parser.js */; };
04EEDCFE1E02F5180023114F /* demo.json in Resources */ = {isa = PBXBuildFile; fileRef = 04EEDCFC1E02F5180023114F /* demo.json */; };
04EEDCFF1E02F5180023114F /* hello.json in Resources */ = {isa = PBXBuildFile; fileRef = 04EEDCFD1E02F5180023114F /* hello.json */; };
5E09562D1DA33515007ADC78 /* JasonLabelComponent.m in Sources */ = {isa = PBXBuildFile; fileRef = 5E09562C1DA33514007ADC78 /* JasonLabelComponent.m */; };
Expand Down Expand Up @@ -76,7 +76,7 @@
/* Begin PBXFileReference section */
045E5F3B1E3661060088D5E6 /* JasonReturnAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JasonReturnAction.h; sourceTree = "<group>"; };
045E5F3C1E3661060088D5E6 /* JasonReturnAction.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JasonReturnAction.m; sourceTree = "<group>"; };
045E5F551E42BBDB0088D5E6 /* parser.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = parser.js; sourceTree = "<group>"; };
045E5F571E44E5180088D5E6 /* parser.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = parser.js; sourceTree = "<group>"; };
04EEDCFC1E02F5180023114F /* demo.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = demo.json; sourceTree = "<group>"; };
04EEDCFD1E02F5180023114F /* hello.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = hello.json; sourceTree = "<group>"; };
1BD8E8486EE7AF4E4934685E /* Pods-Jasonette.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Jasonette.release.xcconfig"; path = "Pods/Target Support Files/Pods-Jasonette/Pods-Jasonette.release.xcconfig"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -407,7 +407,7 @@
isa = PBXGroup;
children = (
5E31769B1D1E411E00D87778 /* csv.js */,
045E5F551E42BBDB0088D5E6 /* parser.js */,
045E5F571E44E5180088D5E6 /* parser.js */,
5E3176F41D1E411E00D87778 /* rss.js */,
);
name = Lib;
Expand Down Expand Up @@ -728,7 +728,7 @@
04EEDCFE1E02F5180023114F /* demo.json in Resources */,
5E31771E1D1E411F00D87778 /* JasonVerticalSectionItem.xib in Resources */,
5E31777A1D1E4A8E00D87778 /* settings.plist in Resources */,
045E5F561E42BBDB0088D5E6 /* parser.js in Resources */,
045E5F581E44E5180088D5E6 /* parser.js in Resources */,
5E3177251D1E411F00D87778 /* JasonHorizontalSectionItem.xib in Resources */,
5E3177371D1E411F00D87778 /* icon-info.png in Resources */,
04EEDCFF1E02F5180023114F /* hello.json in Resources */,
Expand Down
2 changes: 1 addition & 1 deletion app/Jasonette/parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -22236,7 +22236,7 @@ var fillout = function(options){
// If the pattern ends with a return statement, but is NOT wrapped inside another function ([^}]*$), it's a function expression
if(/\breturn [^;]+;?[ ]*$/.test(slot) && /return[^}]*$/.test(slot)){
// Function expression with explicit "return" expression
func = Function("with(this){return (function(){" + slot + "})()}").bind(data);
func = Function("with(this){" + slot + "}").bind(data);
} else {
// Function expression with explicit "return" expression
// Ordinary simple expression that
Expand Down

0 comments on commit 1ce810c

Please sign in to comment.