summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/system.nim2
-rw-r--r--lib/system/jssys.nim5
2 files changed, 5 insertions, 2 deletions
diff --git a/lib/system.nim b/lib/system.nim
index 5d6fcf868..f584f7590 100644
--- a/lib/system.nim
+++ b/lib/system.nim
@@ -2163,7 +2163,7 @@ proc `&` *[T](x: T, y: seq[T]): seq[T] {.noSideEffect.} =
     result[i+1] = y[i]
 
 when not defined(nimscript):
-  when not defined(JS):
+  when not defined(JS) or defined(nimphp):
     proc seqToPtr[T](x: seq[T]): pointer {.inline, nosideeffect.} =
       result = cast[pointer](x)
   else:
diff --git a/lib/system/jssys.nim b/lib/system/jssys.nim
index 220683717..99997efe6 100644
--- a/lib/system/jssys.nim
+++ b/lib/system/jssys.nim
@@ -121,7 +121,10 @@ proc raiseException(e: ref Exception, ename: cstring) {.
   when not defined(noUnhandledHandler):
     if excHandler == 0:
       unhandledException(e)
-  asm "throw `e`;"
+  when defined(nimphp):
+    asm """throw new Exception($`e`["message"]);"""
+  else:
+    asm "throw `e`;"
 
 proc reraiseException() {.compilerproc, asmNoStackFrame.} =
   if lastJSError == nil: