File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -40,7 +40,6 @@ goog.provide('jspb.ExtensionFieldInfo');
4040goog . provide ( 'jspb.Message' ) ;
4141
4242goog . require ( 'goog.array' ) ;
43- goog . require ( 'goog.asserts' ) ;
4443goog . require ( 'goog.crypt.base64' ) ;
4544goog . require ( 'jspb.BinaryReader' ) ;
4645goog . require ( 'jspb.Map' ) ;
@@ -1825,8 +1824,10 @@ jspb.Message.cloneMessage = function(msg) {
18251824jspb . Message . copyInto = function ( fromMessage , toMessage ) {
18261825 goog . asserts . assertInstanceof ( fromMessage , jspb . Message ) ;
18271826 goog . asserts . assertInstanceof ( toMessage , jspb . Message ) ;
1828- goog . asserts . assert ( fromMessage . constructor == toMessage . constructor ,
1829- 'Copy source and target message should have the same type.' ) ;
1827+
1828+ if ( fromMessage . constructor !== toMessage . constructor )
1829+ throw new Error ( 'Copy source and target message should have the same type.' ) ;
1830+
18301831 var copyOfFrom = jspb . Message . clone ( fromMessage ) ;
18311832
18321833 var to = toMessage . toArray ( ) ;
You can’t perform that action at this time.
0 commit comments