Skip to content

Commit d94a282

Browse files
committed
py,js: implement is#, isnot#
1 parent e3cc2f8 commit d94a282

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

js/jscompiler.vim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -656,7 +656,7 @@ function s:JavascriptCompiler.compile_isci(node)
656656
endfunction
657657

658658
function s:JavascriptCompiler.compile_iscs(node)
659-
throw 'NotImplemented: is#'
659+
return self.compile_op2(a:node, '===')
660660
endfunction
661661

662662
function s:JavascriptCompiler.compile_isnot(node)
@@ -668,7 +668,7 @@ function s:JavascriptCompiler.compile_isnotci(node)
668668
endfunction
669669

670670
function s:JavascriptCompiler.compile_isnotcs(node)
671-
throw 'NotImplemented: isnot#'
671+
return self.compile_op2(a:node, '!==')
672672
endfunction
673673

674674
function s:JavascriptCompiler.compile_add(node)

py/pycompiler.vim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -691,7 +691,7 @@ function s:PythonCompiler.compile_isci(node)
691691
endfunction
692692

693693
function s:PythonCompiler.compile_iscs(node)
694-
throw 'NotImplemented: is#'
694+
return self.compile_op2(a:node, 'is')
695695
endfunction
696696

697697
function s:PythonCompiler.compile_isnot(node)
@@ -703,7 +703,7 @@ function s:PythonCompiler.compile_isnotci(node)
703703
endfunction
704704

705705
function s:PythonCompiler.compile_isnotcs(node)
706-
throw 'NotImplemented: isnot#'
706+
return self.compile_op2(a:node, 'is not')
707707
endfunction
708708

709709
function s:PythonCompiler.compile_add(node)

0 commit comments

Comments
 (0)