Created
July 18, 2010 20:36
-
-
Save goyox86/480689 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From 39899b7c48c272a6c049d2baf7411ed13eaed880 Mon Sep 17 00:00:00 2001 | |
From: Jose Narvaez <[email protected]> | |
Date: Sun, 18 Jul 2010 16:03:12 -0430 | |
Subject: [PATCH 2/2] Kernel.extend now raises a TypeError, when called on a frozen object | |
--- | |
kernel/common/kernel.rb | 2 ++ | |
1 files changed, 2 insertions(+), 0 deletions(-) | |
diff --git a/kernel/common/kernel.rb b/kernel/common/kernel.rb | |
index fb897af..1471100 100644 | |
--- a/kernel/common/kernel.rb | |
+++ b/kernel/common/kernel.rb | |
@@ -380,6 +380,8 @@ module Kernel | |
end | |
def extend(*modules) | |
+ Ruby.check_frozen | |
+ | |
modules.reverse_each do |mod| | |
mod.__send__(:extend_object, self) | |
mod.__send__(:extended, self) | |
-- | |
1.7.0.3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment