summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2013-10-06 00:10:54 +0200
committerAraq <rumpf_a@web.de>2013-10-06 00:10:54 +0200
commit27215e89f92e039afa166bd8c2c76047595d3f85 (patch)
tree29668a9201a5c263804b9f54967bca43370ce31b
parentac474a281204fbbc5cfa817106c0b4c745240f18 (diff)
parentcb1a278e001fe2a511e28ed95fdda2f58d0a4795 (diff)
downloadNim-27215e89f92e039afa166bd8c2c76047595d3f85.tar.gz
Merge branch 'master' of https://github.com/Araq/Nimrod
-rw-r--r--compiler/jsgen.nim4
-rw-r--r--lib/pure/basic3d.nim2
-rw-r--r--tests/js/testmagic.nim10
3 files changed, 13 insertions, 3 deletions
diff --git a/compiler/jsgen.nim b/compiler/jsgen.nim
index eadad27d0..fec14870e 100644
--- a/compiler/jsgen.nim
+++ b/compiler/jsgen.nim
@@ -302,12 +302,12 @@ const # magic checked op; magic unchecked op; checked op; unchecked op
     ["", "", "($1 <= $2)", "($1 <= $2)"], # LeB
     ["", "", "($1 < $2)", "($1 < $2)"], # LtB
     ["", "", "($1 == $2)", "($1 == $2)"], # EqRef
-    ["", "", "($1 == $2)", "($1 == $2)"], # EqProc
     ["", "", "($1 == $2)", "($1 == $2)"], # EqUntracedRef
     ["", "", "($1 <= $2)", "($1 <= $2)"], # LePtr
     ["", "", "($1 < $2)", "($1 < $2)"], # LtPtr
     ["", "", "($1 == $2)", "($1 == $2)"], # EqCString
     ["", "", "($1 != $2)", "($1 != $2)"], # Xor
+    ["", "", "($1 == $2)", "($1 == $2)"], # EqProc
     ["NegInt", "", "NegInt($1)", "-($1)"], # UnaryMinusI
     ["NegInt64", "", "NegInt64($1)", "-($1)"], # UnaryMinusI64
     ["AbsInt", "", "AbsInt($1)", "Math.abs($1)"], # AbsI
@@ -402,12 +402,12 @@ const # magic checked op; magic unchecked op; checked op; unchecked op
     ["", "", "($1 <= $2)", "($1 <= $2)"], # LeB
     ["", "", "($1 < $2)", "($1 < $2)"], # LtB
     ["", "", "($1 == $2)", "($1 == $2)"], # EqRef
-    ["", "", "($1 == $2)", "($1 == $2)"], # EqProc
     ["", "", "($1 == $2)", "($1 == $2)"], # EqUntracedRef
     ["", "", "($1 <= $2)", "($1 <= $2)"], # LePtr
     ["", "", "($1 < $2)", "($1 < $2)"], # LtPtr
     ["", "", "($1 == $2)", "($1 == $2)"], # EqCString
     ["", "", "($1 != $2)", "($1 != $2)"], # Xor
+    ["", "", "($1 == $2)", "($1 == $2)"], # EqProc
     ["NegInt", "", "NegInt($1)", "-($1)"], # UnaryMinusI
     ["NegInt64", "", "NegInt64($1)", "-($1)"], # UnaryMinusI64
     ["AbsInt", "", "AbsInt($1)", "Math.abs($1)"], # AbsI
diff --git a/lib/pure/basic3d.nim b/lib/pure/basic3d.nim
index fda07918f..540d53fd9 100644
--- a/lib/pure/basic3d.nim
+++ b/lib/pure/basic3d.nim
@@ -1001,7 +1001,7 @@ proc scale*(p:var TPoint3d,fac:float) {.inline.}=
 proc scale*(p:var TPoint3d,fac:float,org:TPoint3d){.inline.}=
   ## Scales the point in place `fac` times with `org` as origin.
   p.x=(p.x - org.x) * fac + org.x
-  p.y=(p.x - org.y) * fac + org.y
+  p.y=(p.y - org.y) * fac + org.y
   p.z=(p.z - org.z) * fac + org.z
 
 proc stretch*(p:var TPoint3d,facx,facy,facz:float){.inline.}=
diff --git a/tests/js/testmagic.nim b/tests/js/testmagic.nim
new file mode 100644
index 000000000..2c02d24be
--- /dev/null
+++ b/tests/js/testmagic.nim
@@ -0,0 +1,10 @@
+discard """
+  cmd: "nimrod js --hints:on -r $# $#"
+  output: '''true'''
+"""
+
+# This file tests some magic
+
+var foo = cstring("foo")
+var bar = cstring("foo")
+echo(foo == bar)